Decompiled source of WinnerPick v1.0.2

WinnerPick.dll

Decompiled 4 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using Microsoft.CodeAnalysis;
using UnboundLib;
using UnboundLib.GameModes;
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("WinnerPick")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("WinnerPick")]
[assembly: AssemblyTitle("WinnerPick")]
[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 WinnerPick
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("dev.scyye.rounds.winnerpick", "Winner Pick", "1.0.2")]
	[BepInProcess("Rounds.exe")]
	public class Main : BaseUnityPlugin
	{
		internal const string ModId = "dev.scyye.rounds.winnerpick";

		private const string ModName = "Winner Pick";

		public const string Version = "1.0.2";

		private void Start()
		{
			Unbound.RegisterCredits("Winner Pick", new string[2] { "Scyye", "willuwontu (old ver)" }, new string[1] { "github" }, new string[1] { "https://github.com/willuwontu/WillsWackyGameModes" });
			GameModeManager.AddHook("PickStart", (Func<IGameModeHandler, IEnumerator>)WinnerPicks);
		}

		internal static IEnumerator WinnerPicks(IGameModeHandler gm)
		{
			List<Player> winners = PlayerManager.instance.players.Where((Player p) => GameModeManager.CurrentHandler.GetRoundWinners().Contains(p.teamID)).ToList();
			foreach (Player player in winners)
			{
				if (PlayerManager.instance.players.Contains(player))
				{
					yield return GameModeManager.TriggerHook("PlayerPickStart");
					CardChoiceVisuals.instance.Show(player.playerID, true);
					yield return CardChoice.instance.DoPick(1, player.playerID, (PickerType)1);
					yield return GameModeManager.TriggerHook("PlayerPickEnd");
					yield return (object)new WaitForSecondsRealtime(0.1f);
				}
			}
		}
	}
}