Decompiled source of Madgeios Cards Pack v1.1.6

MADGEIOcustomcards.dll

Decompiled 3 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using Microsoft.CodeAnalysis;
using UnboundLib;
using UnboundLib.Cards;
using UnityEngine;

[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("MADGEIOcustomcards")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MADGEIOcustomcards")]
[assembly: AssemblyTitle("MADGEIOcustomcards")]
[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 MadgeiosModPack
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.madgeios.customcards", "Madgeios Cards", "1.1.6")]
	[BepInProcess("Rounds.exe")]
	public class MyMod : BaseUnityPlugin
	{
		private const string ModId = "com.madgeios.customcards";

		private const string ModName = "Madgeios Cards";

		private const string Version = "1.1.6";

		private void Awake()
		{
		}

		private void Start()
		{
			CustomCard.BuildCard<LaserCard>();
			CustomCard.BuildCard<VerminCard>();
		}
	}
	public class LaserCard : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers)
		{
			gun.attackSpeed = 0.02f;
			gun.projectileSpeed = 15f;
			gun.ammo += 10;
			gun.spread = 0f;
			gun.damage = 0.02f;
		}

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

		protected override string GetDescription()
		{
			return "Your gun turns into a high velocity, low damaging laser.";
		}

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

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

		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
			return (CardInfoStat[])(object)new CardInfoStat[5]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Attack Speed",
					amount = "Instant",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Bullet Speed",
					amount = "Instant",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Ammo",
					amount = "+20",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Spread",
					amount = "Zero",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Damage",
					amount = "-92%",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		public override void Callback()
		{
		}

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

		protected override GameObject GetCardArt()
		{
			return null;
		}
	}
	public class VerminCard : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers)
		{
			gun.attackSpeed *= 1.25f;
			gun.reloadTime *= 1.25f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			VerminBulletModifier orAddComponent = ExtensionMethods.GetOrAddComponent<VerminBulletModifier>(((Component)gun).gameObject, false);
			orAddComponent.gun = gun;
		}

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

		protected override string GetDescription()
		{
			return "Bullets twist and crawl like parasites.";
		}

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

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)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
			//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
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Attack Speed",
					amount = "-25%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Reload Time",
					amount = "+25%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Bullet Behaviour",
					amount = "Crawling",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		public override void Callback()
		{
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}
	}
	public class VerminBulletModifier : MonoBehaviour
	{
		public Gun gun;

		private void Start()
		{
			if ((Object)(object)gun != (Object)null)
			{
				Gun obj = gun;
				obj.ShootPojectileAction = (Action<GameObject>)Delegate.Combine(obj.ShootPojectileAction, new Action<GameObject>(ApplyVerminEffects));
			}
		}

		private void ApplyVerminEffects(GameObject projectile)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)projectile == (Object)null)
			{
				return;
			}
			SpriteRenderer[] componentsInChildren = projectile.GetComponentsInChildren<SpriteRenderer>();
			foreach (SpriteRenderer val in componentsInChildren)
			{
				val.color = Color.red;
			}
			Renderer[] componentsInChildren2 = projectile.GetComponentsInChildren<Renderer>();
			foreach (Renderer val2 in componentsInChildren2)
			{
				if ((Object)(object)val2.material != (Object)null)
				{
					val2.material.color = Color.red;
				}
			}
			TrailRenderer[] componentsInChildren3 = projectile.GetComponentsInChildren<TrailRenderer>();
			foreach (TrailRenderer val3 in componentsInChildren3)
			{
				val3.startColor = Color.red;
				val3.endColor = Color.red;
			}
			projectile.AddComponent<ReverseSneakyBehaviour>();
		}

		private void OnDestroy()
		{
			if ((Object)(object)gun != (Object)null)
			{
				Gun obj = gun;
				obj.ShootPojectileAction = (Action<GameObject>)Delegate.Remove(obj.ShootPojectileAction, new Action<GameObject>(ApplyVerminEffects));
			}
		}
	}
	public class ReverseSneakyBehaviour : MonoBehaviour
	{
		private MoveTransform moveTransform;

		private void Start()
		{
			moveTransform = ((Component)this).GetComponent<MoveTransform>();
		}

		private void Update()
		{
			//IL_001b: 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_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: 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)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: 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_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)moveTransform == (Object)null))
			{
				Vector2 val = Vector2.op_Implicit(moveTransform.velocity);
				if (!(((Vector2)(ref val)).magnitude < 0.01f))
				{
					Vector2 normalized = ((Vector2)(ref val)).normalized;
					float num = 120f * Time.deltaTime;
					Vector2 val2 = Vector2.op_Implicit(Quaternion.Euler(0f, 0f, num) * Vector2.op_Implicit(normalized));
					moveTransform.velocity = Vector2.op_Implicit(((Vector2)(ref val2)).normalized * ((Vector2)(ref val)).magnitude);
				}
			}
		}
	}
}