using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using AutoEscape;
using BTD_Mod_Helper;
using BTD_Mod_Helper.Extensions;
using Il2CppAssets.Scripts.Models.Bloons.Behaviors;
using Il2CppAssets.Scripts.Simulation.Bloons;
using Il2CppAssets.Scripts.Unity.UI_New.InGame;
using MelonLoader;
using Microsoft.CodeAnalysis;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(AutoEscapeMod), "Auto-Escape", "1.1.3", "doombubbles", null)]
[assembly: MelonGame("Ninja Kiwi", "BloonsTD6")]
[assembly: MelonGame("Ninja Kiwi", "BloonsTD6-Epic")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("AutoEscape")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+c8a1a15729131c7fd885a12375c997e995a9fac7")]
[assembly: AssemblyProduct("AutoEscape")]
[assembly: AssemblyTitle("AutoEscape")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
}
}
}
namespace AutoEscape
{
public class AutoEscapeMod : BloonsTD6Mod
{
public override bool PreBloonLeaked(Bloon bloon)
{
if (bloon.GetModifiedTotalLeakDamage() >= InGame.instance.bridge.GetHealth() + InGame.Bridge.simulation.Shield && !InGameData.CurrentGame.IsSandbox && !BloonModelBehaviorExt.HasBehavior<GoldenBloonModel>(bloon.bloonModel) && InGameData.CurrentGame.bossRushData == null)
{
if (!InGame.instance.quitting)
{
InGame.instance.Quit(false);
ModHelper.Msg<AutoEscapeMod>((object)"You're Welcome.");
}
return false;
}
return true;
}
}
public static class ModHelperData
{
public const string WorksOnVersion = "52.2";
public const string Version = "1.1.3";
public const string Name = "Auto-Escape";
public const string Description = "Automatically quits to the main menu when a Bloon would otherwise leak and kill you.";
public const string RepoOwner = "doombubbles";
public const string PrevRepoName = "auto-escape";
public const string RepoName = "AutoEscape";
}
}