Decompiled source of Pack Of Cards v1.5.0

ModOutsideStarter.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
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: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("Lil_yeety92")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ModOutsideStarter")]
[assembly: AssemblyTitle("ModOutsideStarter")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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]
	[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;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ModOutsideStarter
{
	[BepInPlugin("Lil_yeety92.ModOutsideStarter", "ModOutsideStarter", "1.0")]
	public class ModOutsideStarter : BaseUnityPlugin
	{
		public GameObject pack = GameObject.Find("Pack_Of_Cards");

		internal static ModOutsideStarter Instance { get; private set; }

		internal static ManualLogSource Logger => Instance._logger;

		private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger;

		internal Harmony? Harmony { get; set; }

		private void Awake()
		{
			Instance = this;
			Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!");
		}

		private void Update()
		{
			if ((Object)(object)pack != (Object)null)
			{
				Logger.LogInfo((object)"PackOpenMono & CardSwap have both been loaded! :)");
				pack.AddComponent<PackOpenMono>();
				pack.AddComponent<CardSwap>();
			}
		}
	}
}

PackOfCardsScripts.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Microsoft.CodeAnalysis;
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: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("Lil_yeety92")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PackOfCardsScripts")]
[assembly: AssemblyTitle("PackOfCardsScripts")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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]
	[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;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class CardSwap : MonoBehaviour
{
	private GameObject CardPrefab1;

	private GameObject CardPrefab2;

	private GameObject CardPrefab3;

	private GameObject CardPrefab4;

	private GameObject CardPrefab5;

	private GameObject CardPrefab6;

	private GameObject CardPrefab7;

	private GameObject CardPrefab8;

	private GameObject CardPrefab9;

	private GameObject CardPrefab10;

	private void Start()
	{
		Debug.Log((object)"CardSwap script initialized.");
		CardPrefab1 = GameObject.Find("Xtremly_Rare_Card_P");
		CardPrefab2 = GameObject.Find("Rare_Card_1_P");
		CardPrefab3 = GameObject.Find("2nd_Rare_Card");
		CardPrefab4 = GameObject.Find("3rd_Rarest_Card_P");
		CardPrefab5 = GameObject.Find("Base_Card_P");
		CardPrefab6 = GameObject.Find("4th_Rarest_Card_P");
		CardPrefab7 = GameObject.Find("The_Card_Card_P");
		CardPrefab8 = GameObject.Find("3rd_Worst_Card_P");
		CardPrefab9 = GameObject.Find("2nd_Worst_Card_P");
		CardPrefab10 = GameObject.Find("M_Card_P");
		Debug.Log((object)("CardPrefabs initialized: " + ((object)CardPrefab1)?.ToString() + ", " + ((object)CardPrefab2)?.ToString() + ", " + ((object)CardPrefab3)?.ToString() + ", " + ((object)CardPrefab4)?.ToString() + ", " + ((object)CardPrefab5)?.ToString() + ", " + ((object)CardPrefab6)?.ToString() + ", " + ((object)CardPrefab7)?.ToString() + ", " + ((object)CardPrefab8)?.ToString() + ", " + ((object)CardPrefab9)?.ToString() + ", " + (object)CardPrefab10));
	}

	public void SwapCard(int cardNumber)
	{
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = null;
		switch (cardNumber)
		{
		case 1:
			val = CardPrefab1;
			break;
		case 2:
			val = CardPrefab2;
			break;
		case 3:
			val = CardPrefab3;
			break;
		case 4:
			val = CardPrefab4;
			break;
		case 5:
			val = CardPrefab5;
			break;
		case 6:
			val = CardPrefab6;
			break;
		case 7:
			val = CardPrefab7;
			break;
		case 8:
			val = CardPrefab8;
			break;
		case 9:
			val = CardPrefab9;
			break;
		case 10:
			val = CardPrefab10;
			break;
		default:
			Debug.LogWarning((object)("Invalid card number: " + cardNumber));
			return;
		}
		if ((Object)(object)val != (Object)null)
		{
			Object.Instantiate<GameObject>(val, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform);
			Debug.Log((object)("Pack Successfully Swapped to card.... :" + cardNumber));
		}
	}
}
public class PackOpenMono : MonoBehaviour
{
	private ItemToggle itemToggle;

	private PhysGrabObjectImpactDetector physGrabObjectImpactDetector;

	internal CardSwap cardSwap;

	public float A = 1f;

	public float B = 2f;

	public float C = 3f;

	public float D = 4f;

	public float E = 5f;

	public float F = 6f;

	public float G = 7f;

	public float H = 8f;

	public float I = 9f;

	public float J = 10f;

	private int cardNmb;

	private void Start()
	{
		itemToggle = ((Component)this).GetComponent<ItemToggle>();
		physGrabObjectImpactDetector = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>();
		cardSwap = ((Component)this).GetComponent<CardSwap>();
		Debug.Log((object)"PackOpenMono script initialized.");
	}

	private void Update()
	{
		itemToggle = ((Component)this).GetComponent<ItemToggle>();
		physGrabObjectImpactDetector = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>();
		cardSwap = ((Component)this).GetComponent<CardSwap>();
		if (((Behaviour)itemToggle).enabled)
		{
			physGrabObjectImpactDetector.DestroyObject(true);
			A /= 10f;
			B /= 10f;
			C /= 10f;
			D /= 10f;
			E /= 10f;
			F /= 10f;
			G /= 10f;
			H /= 10f;
			I /= 10f;
			J /= 10f;
			Debug.Log((object)"PackOpenMono if-true script initialized.");
			float num = Random.Range(0f, 1f);
			if (num < A)
			{
				cardNmb = 1;
			}
			if (B >= num && num > A)
			{
				cardNmb = 2;
			}
			if (C >= num && num > B)
			{
				cardNmb = 3;
			}
			if (D >= num && num > C)
			{
				cardNmb = 4;
			}
			if (E >= num && num > D)
			{
				cardNmb = 5;
			}
			if (F >= num && num > E)
			{
				cardNmb = 6;
			}
			if (G >= num && num > F)
			{
				cardNmb = 7;
			}
			if (H >= num && num > G)
			{
				cardNmb = 8;
			}
			if (I >= num && num > H)
			{
				cardNmb = 9;
			}
			if (J >= num && num > I)
			{
				cardNmb = 10;
			}
			else
			{
				cardNmb = 5;
			}
			cardSwap.SwapCard(cardNmb);
		}
	}
}