Decompiled source of AwesomeMod v1.1.0

Mod.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
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: AssemblyTitle("Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Mod")]
[assembly: AssemblyCopyright("Copyright ©  2020")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("57445610-0892-47c3-be16-453172104123")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 Mod
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("spaghettimonster.etg.awesomemod", "Awesome Mod", "0.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string GUID = "spaghettimonster.etg.awesomemod";

		public const string NAME = "Awesome Mod";

		public const string VERSION = "0.0.0";

		public const string TEXT_COLOR = "#00FFFF";

		public void Start()
		{
			ETGModMainBehaviour.WaitForGameManagerStart((Action<GameManager>)GMStart);
		}

		public void GMStart(GameManager g)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			Application.logMessageReceived += new LogCallback(Awesomeness);
			Log("Awesome Mod v0.0.0 started successfully.", "#00FFFF");
		}

		public void Awesomeness(string condition, string stackTrace, LogType type)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			if ((int)type != 4 || !GameManager.HasInstance || GameManager.Instance.AllPlayers == null)
			{
				return;
			}
			for (int i = 0; i < GameManager.Instance.AllPlayers.Length; i++)
			{
				PlayerController val = GameManager.Instance.AllPlayers[i];
				if ((Object)(object)val != (Object)null && (Object)(object)((BraveBehaviour)val).healthHaver != (Object)null && ((BraveBehaviour)val).healthHaver.IsAlive)
				{
					bool nextShotKills = ((BraveBehaviour)val).healthHaver.NextShotKills;
					((BraveBehaviour)val).healthHaver.NextShotKills = true;
					((BraveBehaviour)val).healthHaver.ApplyDamage(100f, new Vector2(0f, 0f), "Heart Attack", (CoreDamageTypes)0, (DamageCategory)5, true, (PixelCollider)null, true);
					((BraveBehaviour)val).healthHaver.NextShotKills = nextShotKills;
				}
			}
		}

		public static void Log(string text, string color = "FFFFFF")
		{
			ETGModConsole.Log((object)("<color=" + color + ">" + text + "</color>"), false);
		}
	}
}