bellusfennec-BF.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnboundLib;
using UnboundLib.Cards;
using UnityEngine;
using bf.Cards;
using bf.Effects;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("bellusfennec-BF")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("bellusfennec-BF")]
[assembly: AssemblyTitle("bellusfennec-BF")]
[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 bf
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.bellusfennec.rounds.mod", "BFRM", "1.0.0")]
	[BepInProcess("Rounds.exe")]
	public class bf : BaseUnityPlugin
	{
		private const string ModId = "com.bellusfennec.rounds.mod";

		private const string ModName = "BFRM";

		public const string Version = "1.0.0";

		public const string ModInitials = "BFRM";

		public static bf instance { get; private set; }

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

		private void Start()
		{
			Debug.Log((object)"[BFRM][Card] Start.");
			instance = this;
			CustomCard.BuildCard<AntiStunCard>();
		}
	}
}
namespace bf.Effects
{
	public class AntiStunMono : MonoBehaviour
	{
		private CharacterData data;

		private Block block;

		public Player player;

		private Gun gun;

		public bool able;

		private readonly float updateDelay = 0.01f;

		private float timeOfLastEffect;

		private float startTime;

		private Vector2 lastMoveSpeed;

		private bool isMove;

		public void Start()
		{
			data = ((Component)this).GetComponentInParent<CharacterData>();
			player = ((Component)this).GetComponent<Player>();
			block = ((Component)this).GetComponent<Block>();
			gun = ((Component)this).GetComponent<Gun>();
			able = false;
			ResetTimer();
			ResetEffectTimer();
		}

		public void Update()
		{
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			if ((double)Time.time < (double)startTime + (double)updateDelay)
			{
				return;
			}
			if (player.data.isStunned)
			{
				((MonoBehaviour)player.data.stunHandler.codeAnim).StopAllCoroutines();
				player.data.stunHandler.codeAnim.currentState = (AnimationUse)2;
				player.data.stunHandler.codeAnim.animations = (CodeAnimationInstance[])(object)new CodeAnimationInstance[0];
				player.data.stunHandler.codeAnim.isPlaying = false;
				Debug.Log((object)string.Format("[{0}][Card] stunTime {1}.", "BFRM", player.data.stunTime));
				Debug.Log((object)string.Format("[{0}][Card] isStunned {1}.", "BFRM", player.data.isStunned));
				player.data.stunHandler.StopStun();
				ExtensionMethods.SetFieldValue((object)player.data.playerVel, "velocity", (object)lastMoveSpeed);
				return;
			}
			try
			{
				lastMoveSpeed = (Vector2)ExtensionMethods.GetFieldValue((object)player.data.playerVel, "velocity");
			}
			catch (Exception)
			{
			}
		}

		private void ResetTimer()
		{
			startTime = Time.time;
		}

		private void ResetEffectTimer()
		{
			timeOfLastEffect = Time.time;
		}

		public void Destroy()
		{
			Object.Destroy((Object)(object)this);
		}
	}
}
namespace bf.Cards
{
	internal class AntiStunCard : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			Debug.Log((object)("[BFRM][Card] " + ((CustomCard)this).GetTitle() + " has been setup."));
			statModifiers.health = 1.2f;
			block.cdAdd = 0.25f;
			statModifiers.movementSpeed = 1.3f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "BFRM", ((CustomCard)this).GetTitle(), player.playerID));
			AntiStunMono antiStunMono = ((Component)player).gameObject.AddComponent<AntiStunMono>();
		}

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

		protected override string GetTitle()
		{
			return "Anti Stun";
		}

		protected override string GetDescription()
		{
			return "Resistant stun effect.";
		}

		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)1;
		}

		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 = true,
					stat = "Health",
					amount = "+20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Move Speed",
					amount = "+30%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Block Cooldown",
					amount = "+0.25s",
					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 "BFRM";
		}
	}
	internal class Temaplate : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			Debug.Log((object)("[BFRM][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)
		{
			Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "BFRM", ((CustomCard)this).GetTitle(), player.playerID));
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "BFRM", ((CustomCard)this).GetTitle(), 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 "BFRM";
		}
	}
}