Decompiled source of Yoavp10s first mod v1.0.2

Round Mod.dll

Decompiled 5 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using BepInEx;
using UnboundLib.Cards;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v10.0", FrameworkDisplayName = ".NET 10.0")]
[assembly: AssemblyCompany("Round Mod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Round Mod")]
[assembly: AssemblyTitle("Round Mod")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Round_Mod.MyCards;

[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.yourname.rounds.mycards", "Yoavp10s First Mod", "1.0.2")]
[BepInProcess("Rounds.exe")]
public class MyCardsMod : BaseUnityPlugin
{
	private const string ModId = "com.yourname.rounds.mycards";

	private const string ModName = "Yoavp10s First Mod";

	public const string Version = "1.0.2";

	private void Start()
	{
		CustomCard.BuildCard<Overclock>();
		CustomCard.BuildCard<SecondWind>();
		CustomCard.BuildCard<SniperOfLife>();
		CustomCard.BuildCard<MoreBouncy>();
		CustomCard.BuildCard<UnaffectalbeBullets>();
		CustomCard.BuildCard<TheSun>();
		CustomCard.BuildCard<AllFromEverything>();
		CustomCard.BuildCard<HailOfAmmunition>();
		((Component)this).gameObject.AddComponent<StatDisplay>();
	}
}
public class SniperOfLife : CustomCard
{
	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers)
	{
		gun.damage = 0.85f;
	}

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
	{
		gun.spread = 0f;
		gun.multiplySpread = 1f;
		gunAmmo.maxAmmo = 1;
	}

	public override void OnRemoveCard()
	{
	}

	protected override string GetTitle()
	{
		return "Sniper Of Life";
	}

	protected override string GetDescription()
	{
		return "Sniper that steals others life.";
	}

	protected override GameObject GetCardArt()
	{
		return null;
	}

	protected override Rarity GetRarity()
	{
		return (Rarity)2;
	}

	protected override CardThemeColorType GetTheme()
	{
		return (CardThemeColorType)3;
	}

	protected override CardInfoStat[] GetStats()
	{
		//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_0014: 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_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: 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_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Expected O, but got Unknown
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: 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_0077: 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_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Expected O, but got Unknown
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Expected O, but got Unknown
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Expected O, but got Unknown
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Expected O, but got Unknown
		return (CardInfoStat[])(object)new CardInfoStat[6]
		{
			new CardInfoStat
			{
				positive = true,
				stat = "Projectile Speed",
				amount = "+400%",
				simepleAmount = (SimpleAmount)3
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Life Steal",
				amount = "+15",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = false,
				stat = "Reload Time",
				amount = "+150%",
				simepleAmount = (SimpleAmount)2
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Damage",
				amount = "+150%",
				simepleAmount = (SimpleAmount)3
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Spread",
				amount = "Reset",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = false,
				stat = "Max Ammo",
				amount = "1",
				simepleAmount = (SimpleAmount)0
			}
		};
	}

	public override string GetModName()
	{
		return "MYCARDS";
	}
}
public class MoreBouncy : CustomCard
{
	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
	{
		gun.damage = 0.85f;
		gun.reflects = 30;
		gun.speedMOnBounce = 1.2f;
	}

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
	{
	}

	public override void OnRemoveCard()
	{
	}

	protected override string GetTitle()
	{
		return "More Bouncy";
	}

	protected override string GetDescription()
	{
		return "The bullets bounce more but deal less damage.";
	}

	protected override GameObject GetCardArt()
	{
		return null;
	}

	protected override Rarity GetRarity()
	{
		return (Rarity)1;
	}

	protected override CardThemeColorType GetTheme()
	{
		return (CardThemeColorType)1;
	}

	protected override CardInfoStat[] GetStats()
	{
		//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_0014: 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_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: 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_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Expected O, but got Unknown
		return (CardInfoStat[])(object)new CardInfoStat[2]
		{
			new CardInfoStat
			{
				positive = false,
				stat = "Damage",
				amount = "-15%",
				simepleAmount = (SimpleAmount)5
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Bounces",
				amount = "+30",
				simepleAmount = (SimpleAmount)0
			}
		};
	}

	public override string GetModName()
	{
		return "MYCARDS";
	}
}
public class UnaffectalbeBullets : CustomCard
{
	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
	{
		gun.unblockable = true;
		gun.ignoreWalls = true;
		gun.bulletPortal = 50;
		gun.damage = 0.95f;
		gun.attackSpeed = 1.5f;
		gun.reloadTime = 1.5f;
	}

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
	{
		gun.unblockable = true;
		gun.ignoreWalls = true;
		gun.bulletPortal = 50;
	}

	public override void OnRemoveCard()
	{
	}

	protected override string GetTitle()
	{
		return "Unaffectalbe Bullets";
	}

	protected override string GetDescription()
	{
		return "The bullets ignore walls.";
	}

	protected override GameObject GetCardArt()
	{
		return null;
	}

	protected override Rarity GetRarity()
	{
		return (Rarity)1;
	}

	protected override CardThemeColorType GetTheme()
	{
		return (CardThemeColorType)1;
	}

	protected override CardInfoStat[] GetStats()
	{
		//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_0014: 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_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: 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_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Expected O, but got Unknown
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: 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_0077: 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_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Expected O, but got Unknown
		return (CardInfoStat[])(object)new CardInfoStat[3]
		{
			new CardInfoStat
			{
				positive = false,
				stat = "Damage",
				amount = "-5%",
				simepleAmount = (SimpleAmount)5
			},
			new CardInfoStat
			{
				positive = false,
				stat = "Attack Speed",
				amount = "+5%",
				simepleAmount = (SimpleAmount)1
			},
			new CardInfoStat
			{
				positive = false,
				stat = "Reload Time",
				amount = "+5%",
				simepleAmount = (SimpleAmount)1
			}
		};
	}

	public override string GetModName()
	{
		return "MYCARDS";
	}
}
public class HailOfAmmunition : CustomCard
{
	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
	{
		gun.numberOfProjectiles = 9;
		gun.bursts = 3;
		gun.spread = 0.5f;
		gun.projectileSpeed = 1.5f;
		gun.drag = 3f;
		gun.damage = 0.2f;
	}

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
	{
		gun.gravity = 0.65f;
	}

	public override void OnRemoveCard()
	{
	}

	protected override string GetTitle()
	{
		return "Hail Of Ammunition";
	}

	protected override string GetDescription()
	{
		return "Shoot a lot of bullets in one shot.";
	}

	protected override GameObject GetCardArt()
	{
		return null;
	}

	protected override Rarity GetRarity()
	{
		return (Rarity)0;
	}

	protected override CardThemeColorType GetTheme()
	{
		return (CardThemeColorType)8;
	}

	protected override CardInfoStat[] GetStats()
	{
		//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_0014: 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_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: 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_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Expected O, but got Unknown
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: 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_0077: 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_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Expected O, but got Unknown
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Expected O, but got Unknown
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Expected O, but got Unknown
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Expected O, but got Unknown
		return (CardInfoStat[])(object)new CardInfoStat[6]
		{
			new CardInfoStat
			{
				positive = true,
				stat = "Number Of Projectiles",
				amount = "+9",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "bursts",
				amount = "+3",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "projectileSpeed",
				amount = "+50%",
				simepleAmount = (SimpleAmount)1
			},
			new CardInfoStat
			{
				positive = false,
				stat = "spread",
				amount = "+0.5",
				simepleAmount = (SimpleAmount)1
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Drag",
				amount = "+3",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = false,
				stat = "spread",
				amount = "-80%",
				simepleAmount = (SimpleAmount)7
			}
		};
	}

	public override string GetModName()
	{
		return "MYCARDS";
	}
}
public class TheSun : CustomCard
{
	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
	{
		gun.damage = 3.5f;
		statModifiers.health = 3.5f;
		gun.gravity = 1f;
		statModifiers.sizeMultiplier = 1.5f;
		statModifiers.gravity = 1.5f;
		gun.damageAfterDistanceMultiplier = 1.1f;
	}

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
	{
	}

	public override void OnRemoveCard()
	{
	}

	protected override string GetTitle()
	{
		return "The Sun";
	}

	protected override string GetDescription()
	{
		return "You are bigger and heavier but you deal a lot more damage and you have more health.";
	}

	protected override GameObject GetCardArt()
	{
		return null;
	}

	protected override Rarity GetRarity()
	{
		return (Rarity)1;
	}

	protected override CardThemeColorType GetTheme()
	{
		return (CardThemeColorType)0;
	}

	protected override CardInfoStat[] GetStats()
	{
		//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_0014: 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_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: 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_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Expected O, but got Unknown
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: 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_0077: 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_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Expected O, but got Unknown
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Expected O, but got Unknown
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Expected O, but got Unknown
		return (CardInfoStat[])(object)new CardInfoStat[5]
		{
			new CardInfoStat
			{
				positive = true,
				stat = "Damage",
				amount = "250%",
				simepleAmount = (SimpleAmount)3
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Health",
				amount = "250%",
				simepleAmount = (SimpleAmount)3
			},
			new CardInfoStat
			{
				positive = false,
				stat = "Bullet Gravity",
				amount = "+1%",
				simepleAmount = (SimpleAmount)1
			},
			new CardInfoStat
			{
				positive = false,
				stat = "Size",
				amount = "+50%",
				simepleAmount = (SimpleAmount)2
			},
			new CardInfoStat
			{
				positive = false,
				stat = "Gravity",
				amount = "+50%",
				simepleAmount = (SimpleAmount)2
			}
		};
	}

	public override string GetModName()
	{
		return "MYCARDS";
	}
}
public class AllFromEverything : CustomCard
{
	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
	{
		gun.damage = 1.1f;
		gun.attackSpeed = 0.9f;
		gun.projectileSize = 1.1f;
		gun.reloadTime = 0.9f;
		gun.knockback = 1.1f;
		gun.multiplySpread = 0.9f;
		gun.ammo = 1;
		gun.numberOfProjectiles = 1;
		gun.bursts = 1;
		gun.reflects = 1;
		gun.spread = -1f;
		gun.drag = -1f;
		gun.gravity = -1f;
		statModifiers.health = 1.1f;
		statModifiers.movementSpeed = 1.1f;
		statModifiers.jump = 1.1f;
		statModifiers.gravity = 0.9f;
		statModifiers.sizeMultiplier = 0.9f;
		statModifiers.secondsToTakeDamageOver = 1.1f;
		statModifiers.numberOfJumps = 1;
		statModifiers.regen = 1f;
		statModifiers.lifeSteal = 1f;
		statModifiers.respawns = 1;
	}

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
	{
	}

	public override void OnRemoveCard()
	{
	}

	protected override string GetTitle()
	{
		return "All From Everything";
	}

	protected override string GetDescription()
	{
		return "Gives a bit from everything.";
	}

	protected override GameObject GetCardArt()
	{
		return null;
	}

	protected override Rarity GetRarity()
	{
		return (Rarity)2;
	}

	protected override CardThemeColorType GetTheme()
	{
		return (CardThemeColorType)6;
	}

	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
		//IL_0035: 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_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)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Expected O, but got Unknown
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: 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_008b: Expected O, but got Unknown
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: 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_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Expected O, but got Unknown
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Expected O, but got Unknown
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Expected O, but got Unknown
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0135: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Expected O, but got Unknown
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0161: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Expected O, but got Unknown
		//IL_0169: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0175: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_018d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Expected O, but got Unknown
		//IL_0196: Unknown result type (might be due to invalid IL or missing references)
		//IL_019b: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c0: Expected O, but got Unknown
		//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01da: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ed: Expected O, but got Unknown
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0207: Unknown result type (might be due to invalid IL or missing references)
		//IL_0212: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_021a: Expected O, but got Unknown
		//IL_021d: 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_0229: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: 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_0241: Unknown result type (might be due to invalid IL or missing references)
		//IL_0247: Expected O, but got Unknown
		//IL_024a: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0256: Unknown result type (might be due to invalid IL or missing references)
		//IL_0261: Unknown result type (might be due to invalid IL or missing references)
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_026e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Expected O, but got Unknown
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_027c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0283: Unknown result type (might be due to invalid IL or missing references)
		//IL_028e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0299: Unknown result type (might be due to invalid IL or missing references)
		//IL_029b: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a1: Expected O, but got Unknown
		//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ce: Expected O, but got Unknown
		//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fb: Expected O, but got Unknown
		//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0303: Unknown result type (might be due to invalid IL or missing references)
		//IL_030a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0315: Unknown result type (might be due to invalid IL or missing references)
		//IL_0321: Expected O, but got Unknown
		//IL_0324: Unknown result type (might be due to invalid IL or missing references)
		//IL_0329: Unknown result type (might be due to invalid IL or missing references)
		//IL_0330: Unknown result type (might be due to invalid IL or missing references)
		//IL_033b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0346: Unknown result type (might be due to invalid IL or missing references)
		//IL_0348: Unknown result type (might be due to invalid IL or missing references)
		//IL_034e: Expected O, but got Unknown
		//IL_0351: Unknown result type (might be due to invalid IL or missing references)
		//IL_0356: Unknown result type (might be due to invalid IL or missing references)
		//IL_035d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0368: Unknown result type (might be due to invalid IL or missing references)
		//IL_0373: Unknown result type (might be due to invalid IL or missing references)
		//IL_0375: Unknown result type (might be due to invalid IL or missing references)
		//IL_037b: Expected O, but got Unknown
		//IL_037e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0383: Unknown result type (might be due to invalid IL or missing references)
		//IL_038a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0395: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a8: Expected O, but got Unknown
		//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d5: Expected O, but got Unknown
		return (CardInfoStat[])(object)new CardInfoStat[22]
		{
			new CardInfoStat
			{
				positive = true,
				stat = "Damage",
				amount = "+10%",
				simepleAmount = (SimpleAmount)1
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Attack Speed",
				amount = "-10%",
				simepleAmount = (SimpleAmount)8
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Projectile Size",
				amount = "+10%",
				simepleAmount = (SimpleAmount)1
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Reload Time",
				amount = "-10%",
				simepleAmount = (SimpleAmount)8
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Knockback",
				amount = "+10%",
				simepleAmount = (SimpleAmount)1
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Multiply Spread",
				amount = "-10%",
				simepleAmount = (SimpleAmount)8
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Ammo",
				amount = "+1",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Mumber Of Projectiles",
				amount = "+1",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Bursts",
				amount = "+1",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Bounces",
				amount = "+1",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Spread",
				amount = "-1",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Drag",
				amount = "-1",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Bullet Gravity",
				amount = "-1",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Health",
				amount = "+10%",
				simepleAmount = (SimpleAmount)1
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Jump",
				amount = "+10%",
				simepleAmount = (SimpleAmount)1
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Gravity",
				amount = "-10%",
				simepleAmount = (SimpleAmount)8
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Size Multiplier",
				amount = "-10%",
				simepleAmount = (SimpleAmount)8
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Seconds To Take Damage Over",
				amount = "+10%"
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Number Of Jumps",
				amount = "+1",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Regen",
				amount = "+1",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Life Steal",
				amount = "+1",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Respawns",
				amount = "+1",
				simepleAmount = (SimpleAmount)0
			}
		};
	}

	public override string GetModName()
	{
		return "MYCARDS";
	}
}
public class Overclock : CustomCard
{
	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers)
	{
		gun.attackSpeed = 0.7f;
		gun.damage = 0.75f;
		gun.ammo = 2;
		cardInfo.allowMultiple = true;
	}

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
	{
	}

	public override void OnRemoveCard()
	{
	}

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

	protected override string GetDescription()
	{
		return "Fire faster. Hit softer.";
	}

	protected override GameObject GetCardArt()
	{
		return null;
	}

	protected override Rarity GetRarity()
	{
		return (Rarity)0;
	}

	protected override CardThemeColorType GetTheme()
	{
		return (CardThemeColorType)3;
	}

	protected override CardInfoStat[] GetStats()
	{
		//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_0014: 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_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: 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_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Expected O, but got Unknown
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: 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_0077: 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_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Expected O, but got Unknown
		return (CardInfoStat[])(object)new CardInfoStat[3]
		{
			new CardInfoStat
			{
				positive = true,
				stat = "Attack Speed",
				amount = "+30%",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = false,
				stat = "Damage",
				amount = "-25%",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Ammo",
				amount = "+2",
				simepleAmount = (SimpleAmount)0
			}
		};
	}

	public override string GetModName()
	{
		return "MYCARDS";
	}
}
public class SecondWind : CustomCard
{
	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers)
	{
		cardInfo.allowMultiple = false;
	}

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
	{
		if ((Object)(object)((Component)player).gameObject.GetComponent<SecondWindEffect>() == (Object)null)
		{
			((Component)player).gameObject.AddComponent<SecondWindEffect>();
		}
	}

	public override void OnRemoveCard()
	{
	}

	protected override string GetTitle()
	{
		return "Second Wind";
	}

	protected override string GetDescription()
	{
		return "Move faster when badly hurt.";
	}

	protected override GameObject GetCardArt()
	{
		return null;
	}

	protected override Rarity GetRarity()
	{
		return (Rarity)2;
	}

	protected override CardThemeColorType GetTheme()
	{
		return (CardThemeColorType)2;
	}

	protected override CardInfoStat[] GetStats()
	{
		//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_0014: 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_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		return (CardInfoStat[])(object)new CardInfoStat[1]
		{
			new CardInfoStat
			{
				positive = true,
				stat = "Movement Speed",
				amount = "+50% below 30% HP",
				simepleAmount = (SimpleAmount)0
			}
		};
	}

	public override string GetModName()
	{
		return "MYCARDS";
	}
}
public class SecondWindEffect : MonoBehaviour
{
	private const float Threshold = 0.3f;

	private const float SpeedBoost = 1.5f;

	private Player player;

	private bool active;

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

	private void Update()
	{
		if (!((Object)(object)player == (Object)null) && !((Object)(object)player.data == (Object)null))
		{
			bool flag = player.data.health / player.data.maxHealth < 0.3f;
			if (flag != active)
			{
				CharacterStatModifiers stats = player.data.stats;
				stats.movementSpeed *= (flag ? 1.5f : (2f / 3f));
				active = flag;
			}
		}
	}

	private void OnDestroy()
	{
		if (active && (Object)(object)player != (Object)null && (Object)(object)player.data != (Object)null)
		{
			CharacterStatModifiers stats = player.data.stats;
			stats.movementSpeed /= 1.5f;
		}
	}
}
public class StatDisplay : MonoBehaviour
{
	private class Section
	{
		public string name;

		public readonly List<KeyValuePair<string, string>> rows = new List<KeyValuePair<string, string>>();
	}

	public KeyCode toggleKey = (KeyCode)286;

	public KeyCode cycleKey = (KeyCode)287;

	private const float RefreshInterval = 0.2f;

	private const float PanelWidth = 340f;

	private static readonly global::System.Type[] ScannedTypes = new global::System.Type[7]
	{
		typeof(CharacterData),
		typeof(CharacterStatModifiers),
		typeof(Gun),
		typeof(GunAmmo),
		typeof(Block),
		typeof(HealthHandler),
		typeof(Gravity)
	};

	private const BindingFlags FieldFlags = (BindingFlags)54;

	private static readonly Dictionary<global::System.Type, FieldInfo[]> fieldCache = new Dictionary<global::System.Type, FieldInfo[]>();

	private readonly List<Section> sections = new List<Section>();

	private string headerText = "";

	private bool visible = true;

	private int playerIndex;

	private float lastRefresh = -999f;

	private Vector2 scroll;

	private GUIStyle boxStyle;

	private GUIStyle headerStyle;

	private GUIStyle keyStyle;

	private GUIStyle valueStyle;

	private Texture2D background;

	private void Update()
	{
		//IL_0001: 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)
		if (Input.GetKeyDown(toggleKey))
		{
			visible = !visible;
		}
		if (Input.GetKeyDown(cycleKey))
		{
			int num = PlayerCount();
			if (num > 0)
			{
				playerIndex = (playerIndex + 1) % num;
			}
			lastRefresh = -999f;
		}
		if (!visible || !(Time.unscaledTime - lastRefresh >= 0.2f))
		{
			return;
		}
		lastRefresh = Time.unscaledTime;
		try
		{
			Rebuild();
		}
		catch (global::System.Exception ex)
		{
			sections.Clear();
			headerText = "error: " + ex.Message;
		}
	}

	private void OnGUI()
	{
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: 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_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		if (!visible)
		{
			return;
		}
		EnsureStyles();
		float num = Mathf.Min((float)Screen.height * 0.7f, 620f);
		Rect val = new Rect(12f, (float)Screen.height - num - 12f, 340f, num);
		GUI.depth = 0;
		GUILayout.BeginArea(val, boxStyle);
		GUILayout.Label(headerText, headerStyle, global::System.Array.Empty<GUILayoutOption>());
		GUILayout.Label("F5 hide   F6 next player", valueStyle, global::System.Array.Empty<GUILayoutOption>());
		GUILayout.Space(4f);
		scroll = GUILayout.BeginScrollView(scroll, global::System.Array.Empty<GUILayoutOption>());
		Enumerator<Section> enumerator = sections.GetEnumerator();
		try
		{
			while (enumerator.MoveNext())
			{
				Section current = enumerator.Current;
				GUILayout.Space(6f);
				GUILayout.Label(current.name, headerStyle, global::System.Array.Empty<GUILayoutOption>());
				Enumerator<KeyValuePair<string, string>> enumerator2 = current.rows.GetEnumerator();
				try
				{
					while (enumerator2.MoveNext())
					{
						KeyValuePair<string, string> current2 = enumerator2.Current;
						GUILayout.BeginHorizontal(global::System.Array.Empty<GUILayoutOption>());
						GUILayout.Label(current2.Key, keyStyle, global::System.Array.Empty<GUILayoutOption>());
						GUILayout.FlexibleSpace();
						GUILayout.Label(current2.Value, valueStyle, global::System.Array.Empty<GUILayoutOption>());
						GUILayout.EndHorizontal();
					}
				}
				finally
				{
					((global::System.IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose();
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose();
		}
		GUILayout.EndScrollView();
		GUILayout.EndArea();
	}

	private void OnDestroy()
	{
		if ((Object)(object)background != (Object)null)
		{
			Object.Destroy((Object)(object)background);
		}
	}

	private static int PlayerCount()
	{
		PlayerManager instance = PlayerManager.instance;
		if ((Object)(object)instance == (Object)null || instance.players == null)
		{
			return 0;
		}
		return instance.players.Count;
	}

	private Player GetTargetPlayer()
	{
		int num = PlayerCount();
		if (num == 0)
		{
			return null;
		}
		if (playerIndex >= num)
		{
			playerIndex = 0;
		}
		return PlayerManager.instance.players[playerIndex];
	}

	private void Rebuild()
	{
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		sections.Clear();
		Player targetPlayer = GetTargetPlayer();
		if ((Object)(object)targetPlayer == (Object)null)
		{
			headerText = "STATS — no players in scene";
			return;
		}
		headerText = $"STATS — player {targetPlayer.playerID} ({playerIndex + 1}/{PlayerCount()})";
		global::System.Type[] scannedTypes = ScannedTypes;
		foreach (global::System.Type type in scannedTypes)
		{
			Component componentInChildren = ((Component)targetPlayer).GetComponentInChildren(type);
			if ((Object)(object)componentInChildren == (Object)null)
			{
				continue;
			}
			Section section = new Section
			{
				name = ((MemberInfo)type).Name
			};
			FieldInfo[] displayableFields = GetDisplayableFields(type);
			foreach (FieldInfo val in displayableFields)
			{
				object value;
				try
				{
					value = val.GetValue((object)componentInChildren);
				}
				catch
				{
					continue;
				}
				section.rows.Add(new KeyValuePair<string, string>(Prettify(((MemberInfo)val).Name), FormatValue(value)));
			}
			if (section.rows.Count > 0)
			{
				sections.Add(section);
			}
		}
	}

	private static FieldInfo[] GetDisplayableFields(global::System.Type type)
	{
		FieldInfo[] result = default(FieldInfo[]);
		if (fieldCache.TryGetValue(type, ref result))
		{
			return result;
		}
		List<FieldInfo> val = new List<FieldInfo>();
		FieldInfo[] fields = type.GetFields((BindingFlags)54);
		foreach (FieldInfo val2 in fields)
		{
			if (((MemberInfo)val2).Name.IndexOf('<') < 0 && IsDisplayable(val2.FieldType))
			{
				val.Add(val2);
			}
		}
		val.Sort((Comparison<FieldInfo>)((FieldInfo a, FieldInfo b) => string.CompareOrdinal(((MemberInfo)a).Name, ((MemberInfo)b).Name)));
		result = val.ToArray();
		fieldCache[type] = result;
		return result;
	}

	private static bool IsDisplayable(global::System.Type t)
	{
		if (!(t == typeof(float)) && !(t == typeof(double)) && !(t == typeof(int)) && !(t == typeof(long)) && !(t == typeof(bool)) && !(t == typeof(string)) && !(t == typeof(Vector2)) && !(t == typeof(Vector3)) && !(t == typeof(Color)))
		{
			return t.IsEnum;
		}
		return true;
	}

	private static string FormatValue(object value)
	{
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: 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_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: 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_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
		if (value == null)
		{
			return "null";
		}
		if (value is float num)
		{
			return num.ToString("0.###");
		}
		if (value is double num2)
		{
			return num2.ToString("0.###");
		}
		if (value is Vector2 val)
		{
			return $"({val.x:0.##}, {val.y:0.##})";
		}
		if (value is Vector3 val2)
		{
			return $"({val2.x:0.##}, {val2.y:0.##}, {val2.z:0.##})";
		}
		if (value is Color val3)
		{
			return $"({val3.r:0.##}, {val3.g:0.##}, {val3.b:0.##})";
		}
		return value.ToString();
	}

	private static string Prettify(string name)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Expected O, but got Unknown
		StringBuilder val = new StringBuilder(name.Length + 8);
		for (int i = 0; i < name.Length; i++)
		{
			char c = name[i];
			if (i == 0)
			{
				val.Append(char.ToUpper(c));
				continue;
			}
			if (char.IsUpper(c) && !char.IsUpper(name[i - 1]))
			{
				val.Append(' ');
			}
			val.Append(c);
		}
		return ((object)val).ToString();
	}

	private void EnsureStyles()
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		//IL_0040: 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_006a: Expected O, but got Unknown
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Expected O, but got Unknown
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Expected O, but got Unknown
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Expected O, but got Unknown
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Expected O, but got Unknown
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		if (boxStyle == null || !((Object)(object)background != (Object)null))
		{
			background = new Texture2D(1, 1);
			background.SetPixel(0, 0, new Color(0f, 0f, 0f, 0.78f));
			background.Apply();
			boxStyle = new GUIStyle(GUI.skin.box);
			boxStyle.normal.background = background;
			boxStyle.padding = new RectOffset(10, 10, 8, 10);
			headerStyle = new GUIStyle(GUI.skin.label);
			headerStyle.fontSize = 12;
			headerStyle.fontStyle = (FontStyle)1;
			headerStyle.normal.textColor = new Color(1f, 0.82f, 0.3f);
			keyStyle = new GUIStyle(GUI.skin.label);
			keyStyle.fontSize = 11;
			keyStyle.normal.textColor = new Color(0.78f, 0.78f, 0.78f);
			valueStyle = new GUIStyle(GUI.skin.label);
			valueStyle.fontSize = 11;
			valueStyle.normal.textColor = Color.white;
		}
	}
}