Decompiled source of CupuycMod v0.1.0

CupuycMod.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.Extensions;
using ModdingUtils.Utils;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: AssemblyVersion("0.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class A_AmmoGain : MonoBehaviour
{
	public void AddAmmo()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Expected O, but got Unknown
		GunAmmo val = new GunAmmo();
		GunAmmoStatModifier val2 = new GunAmmoStatModifier();
		val2.currentAmmo_delta += 3;
		val2.ApplyGunAmmoStatModifier(val);
	}
}
public class A_CoolMushroom : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <Trigger>d__4 : Object, IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public A_CoolMushroom <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <Trigger>d__4(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			if (<>1__state != 0)
			{
				return false;
			}
			<>1__state = -1;
			if (<>4__this.owner.data.view.IsMine)
			{
				<>4__this.owner.data.maxHealth = <>4__this.rnd.Next(1, 201) / 100;
				<>4__this.owner.data.stats.movementSpeed = 1f * <>4__this.mults[<>4__this.rnd.Next(4, 13)];
				<>4__this.owner.data.jumps = 1 + <>4__this.rnd.Next(0, 5);
				<>4__this.owner.data.weaponHandler.gun.damage = <>4__this.rnd.Next(1, 201) / 100;
				<>4__this.owner.data.block.cooldown = 4f * <>4__this.mults[<>4__this.rnd.Next(4, 13)];
				<>4__this.owner.data.weaponHandler.gun.attackSpeed = 0.3f * <>4__this.mults[<>4__this.rnd.Next(0, 18)];
				<>4__this.owner.data.weaponHandler.gun.projectileSpeed = 1f * <>4__this.mults[<>4__this.rnd.Next(4, 13)];
				<>4__this.owner.data.weaponHandler.gun.reloadTime = 2f * <>4__this.mults[<>4__this.rnd.Next(0, 18)];
			}
			return false;
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new NotSupportedException();
		}
	}

	private Random rnd = new Random();

	private Player owner;

	private float[] mults;

	public void Start()
	{
		owner = ((Component)this).GetComponentInParent<Player>();
		GameModeManager.AddHook("BattleStart", (Func<IGameModeHandler, IEnumerator>)([CompilerGenerated] (IGameModeHandler _) => Trigger()));
	}

	[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
	public IEnumerator Trigger()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return (IEnumerator)(object)new <Trigger>d__4(0)
		{
			<>4__this = this
		};
	}

	public void OnDestroy()
	{
		GameModeManager.RemoveHook("BattleStart", (Func<IGameModeHandler, IEnumerator>)([CompilerGenerated] (IGameModeHandler _) => Trigger()));
	}

	public A_CoolMushroom()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Expected O, but got Unknown
		Single[] array = new Single[18];
		RuntimeHelpers.InitializeArray((Array)(object)array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
		mults = (float[])(object)array;
		((MonoBehaviour)this)..ctor();
	}
}
public class CardHolder : MonoBehaviour
{
	public List<GameObject> Cards;

	public List<GameObject> HiddenCards;

	internal void RegisterCards()
	{
		//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_0054: 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)
		Enumerator<GameObject> enumerator = Cards.GetEnumerator();
		try
		{
			while (enumerator.MoveNext())
			{
				GameObject current = enumerator.Current;
				CustomCard.RegisterUnityCard(current, BestModFromCupuyc.modInitials, current.GetComponent<CardInfo>().cardName, true, (Action<CardInfo>)null);
			}
		}
		finally
		{
			((IDisposable)enumerator).Dispose();
		}
		Enumerator<GameObject> enumerator2 = HiddenCards.GetEnumerator();
		try
		{
			while (enumerator2.MoveNext())
			{
				GameObject current2 = enumerator2.Current;
				CustomCard.RegisterUnityCard(current2, BestModFromCupuyc.modInitials, current2.GetComponent<CardInfo>().cardName, false, (Action<CardInfo>)null);
				Cards.instance.AddHiddenCard(current2.GetComponent<CardInfo>());
			}
		}
		finally
		{
			((IDisposable)enumerator2).Dispose();
		}
	}
}
public class JumpShoot : MonoBehaviour
{
	private Player owner;

	public void Start()
	{
		owner = ((Component)this).GetComponentInParent<Player>();
	}

	public void Update()
	{
		//IL_0028: 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_00f2: 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_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		if (!owner.data.view.IsMine)
		{
			return;
		}
		Enumerator<Player> enumerator = PlayerManager.instance.players.GetEnumerator();
		try
		{
			while (enumerator.MoveNext())
			{
				Player current = enumerator.Current;
				if (current.teamID != owner.teamID && !owner.data.isGrounded && owner.data.currentJumps != owner.data.jumps && Math.Abs(owner.data.groundPos.x - current.data.groundPos.x) < 2f && current.data.groundPos.y < owner.data.groundPos.y)
				{
					((Damagable)current.data.healthHandler).CallTakeDamage(Vector2.down * 0.2f, Vector2.op_Implicit(((Component)owner).transform.position), (GameObject)null, owner, true);
				}
			}
		}
		finally
		{
			((IDisposable)enumerator).Dispose();
		}
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("rounds.unbound.plugin.bestmodfromcupuyc", "Best mod from Cupuyc", "0.0.1")]
[BepInProcess("Rounds.exe")]
public class BestModFromCupuyc : BaseUnityPlugin
{
	internal static string modInitials = "BMFC";

	internal static AssetBundle assets;

	private void Awake()
	{
		assets = AssetUtils.LoadAssetBundleFromResources("assets", typeof(BestModFromCupuyc).Assembly);
	}

	private void Start()
	{
		assets.LoadAsset<GameObject>("ModCards").GetComponent<CardHolder>().RegisterCards();
	}
}
public class PunchClass : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <Trigger>d__2 : Object, IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public PunchClass <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <Trigger>d__2(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_014f: 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)
			if (<>1__state != 0)
			{
				return false;
			}
			<>1__state = -1;
			if (<>4__this.owner.data.view.IsMine)
			{
				<>4__this.owner.data.weaponHandler.gun.dontAllowAutoFire = true;
				<>4__this.owner.data.weaponHandler.gun.ammo = 1;
				<>4__this.owner.data.weaponHandler.gun.projectileSpeed = 1f;
				<>4__this.owner.data.weaponHandler.gun.destroyBulletAfter = 0.15f;
				<>4__this.owner.data.weaponHandler.gun.reflects = 0;
				<>4__this.owner.data.weaponHandler.gun.cos = 0f;
				<>4__this.owner.data.weaponHandler.gun.spread = 0f;
				<>4__this.owner.data.weaponHandler.gun.projectileColor = GetPlayerColor.GetColorMin(<>4__this.owner);
			}
			return false;
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new NotSupportedException();
		}
	}

	private Player owner;

	public void Start()
	{
		owner = ((Component)this).GetComponentInParent<Player>();
		GameModeManager.AddHook("BattleStart", (Func<IGameModeHandler, IEnumerator>)([CompilerGenerated] (IGameModeHandler _) => Trigger()));
	}

	[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
	public IEnumerator Trigger()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return (IEnumerator)(object)new <Trigger>d__2(0)
		{
			<>4__this = this
		};
	}

	public void OnDestroy()
	{
		GameModeManager.RemoveHook("BattleStart", (Func<IGameModeHandler, IEnumerator>)([CompilerGenerated] (IGameModeHandler _) => Trigger()));
	}
}
public class RockBottom : MonoBehaviour
{
	private Player owner;

	private float hp;

	private float dmg;

	private float spd;

	private float bcd;

	private float atkspd;

	private float bspd;

	private float rld;

	public void Start()
	{
		owner = ((Component)this).GetComponentInParent<Player>();
	}

	public void Update()
	{
		if (rld != owner.data.weaponHandler.gun.reloadTime && spd != owner.data.stats.movementSpeed)
		{
			hp = owner.data.stats.health;
			spd = owner.data.stats.movementSpeed;
			bcd = owner.data.block.cooldown;
			atkspd = owner.data.weaponHandler.gun.attackSpeed;
			dmg = owner.data.weaponHandler.gun.damage;
			bspd = owner.data.weaponHandler.gun.projectileSpeed;
			rld = owner.data.weaponHandler.gun.reloadTime;
		}
		if (100f > owner.data.stats.health)
		{
			owner.data.stats.health = 100f;
		}
		if (1f > owner.data.stats.movementSpeed)
		{
			owner.data.stats.movementSpeed = 1f;
		}
		if (4f < owner.data.block.cooldown)
		{
			owner.data.block.cooldown = 4f;
		}
		if (1f < owner.data.weaponHandler.gun.attackSpeed)
		{
			owner.data.weaponHandler.gun.attackSpeed = 1f;
		}
		if (1f > owner.data.weaponHandler.gun.damage)
		{
			owner.data.weaponHandler.gun.damage = 1f;
		}
		if (1f > owner.data.weaponHandler.gun.projectileSpeed)
		{
			owner.data.weaponHandler.gun.projectileSpeed = 1f;
		}
		if (2f < owner.data.weaponHandler.gun.reloadTime)
		{
			owner.data.weaponHandler.gun.reloadTime = 2f;
		}
	}
}