Decompiled source of SpeedyEnemies v0.2.0

SpeedyEnemies.dll

Decompiled 7 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using SpeedyEnemies.Patches;
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("SpeedyEnemies")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SpeedyEnemies")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("afaf5352-a47d-4dbc-a78f-0b8683eb7098")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SpeedyEnemies
{
	[BepInPlugin("Poseidon.SpeedyEnemies", "Speedy Enemy Mod", "1.0.0.0")]
	public class SpeedBase : BaseUnityPlugin
	{
		private const string modGUID = "Poseidon.SpeedyEnemies";

		private const string modName = "Speedy Enemy Mod";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("Poseidon.SpeedyEnemies");

		private static SpeedBase Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Poseidon.SpeedyEnemies");
			mls.LogInfo((object)"Mod has Awaken");
			harmony.PatchAll(typeof(SpeedBase));
			harmony.PatchAll(typeof(LootBugPatch));
			harmony.PatchAll(typeof(BeePatch));
			harmony.PatchAll(typeof(MouthDogPatch));
			harmony.PatchAll(typeof(BaboonPatch));
			harmony.PatchAll(typeof(BlobPatch));
			harmony.PatchAll(typeof(ButlerPatch));
			harmony.PatchAll(typeof(ButlerBeePatch));
			harmony.PatchAll(typeof(BabyPatch));
			harmony.PatchAll(typeof(CentipedePatch));
			harmony.PatchAll(typeof(ClayPatch));
			harmony.PatchAll(typeof(CompanyPatch));
			harmony.PatchAll(typeof(ThumberPatch));
			harmony.PatchAll(typeof(GhostPatch));
			harmony.PatchAll(typeof(BrakenPatch));
			harmony.PatchAll(typeof(SnakePatch));
			harmony.PatchAll(typeof(GiantPatch));
			harmony.PatchAll(typeof(JesterPatch));
			harmony.PatchAll(typeof(MaskPatch));
			harmony.PatchAll(typeof(NutPatch));
			harmony.PatchAll(typeof(PufferPatch));
			harmony.PatchAll(typeof(MechPatch));
			harmony.PatchAll(typeof(SpiderPatch));
			harmony.PatchAll(typeof(WormPatch));
			harmony.PatchAll(typeof(CoilPatch));
			harmony.PatchAll(typeof(BirdPatch));
		}
	}
}
namespace SpeedyEnemies.Patches
{
	[HarmonyPatch(typeof(BaboonBirdAI))]
	internal class BaboonPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void baboonPatch(ref BaboonBirdAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(DoublewingAI))]
	internal class BirdPatch
	{
		[HarmonyPostfix]
		private static void birdPatch(ref DoublewingAI __instance)
		{
			__instance.maxSpeed *= 10f;
			__instance.speedElevationMultiplier *= 10f;
		}

		[HarmonyPatch("DoAIInterval")]
		[HarmonyPostfix]
		private static void birdPatch2(ref DoublewingAI __instance)
		{
			__instance.maxSpeed *= 10f;
		}
	}
	[HarmonyPatch(typeof(BlobAI))]
	internal class BlobPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void blobPatch(ref BlobAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(RedLocustBees))]
	internal class BeePatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void beePatch(ref RedLocustBees __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(FlowermanAI))]
	internal class BrakenPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void brakPatch2(ref FlowermanAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}

		[HarmonyPatch("EnterAngerModeClientRpc")]
		[HarmonyPostfix]
		private static void brakPatch(ref FlowermanAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(ButlerBeesEnemyAI))]
	internal class ButlerBeePatch
	{
		[HarmonyPatch("DoAIInterval")]
		[HarmonyPostfix]
		private static void bulterPatch(ref ButlerBeesEnemyAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(ButlerEnemyAI))]
	internal class ButlerPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void bulterPatch(ref ButlerEnemyAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(CentipedeAI))]
	internal class CentipedePatch
	{
		[HarmonyPatch("IncreaseSpeedSlowly")]
		[HarmonyPostfix]
		private static void CentiPatch(ref CentipedeAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(ClaySurgeonAI))]
	internal class ClayPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void CentiPatch(ref ClaySurgeonAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(SpringManAI))]
	internal class CoilPatch
	{
		[HarmonyPatch("DoAIInterval")]
		[HarmonyPostfix]
		private static void coilPatch(ref SpringManAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}

		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void coilPatch2(ref SpringManAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(EnemyAI))]
	internal class CompanyPatch
	{
		[HarmonyPostfix]
		private static void CompPatch(ref EnemyAI __instance)
		{
			__instance.syncMovementSpeed *= 10f;
		}
	}
	[HarmonyPatch(typeof(Turret))]
	internal class CompanyPatch2
	{
		[HarmonyPostfix]
		private static void CompPatch(ref Turret __instance)
		{
			__instance.rotationSpeed *= 10f;
		}
	}
	[HarmonyPatch(typeof(DressGirlAI))]
	internal class GhostPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void ghostPatch(ref DressGirlAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}

		[HarmonyPatch("BeginChasing")]
		[HarmonyPostfix]
		private static void ghostPatch2(ref DressGirlAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(ForestGiantAI))]
	internal class GiantPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void giantPatch(ref ForestGiantAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(JesterAI))]
	internal class JesterPatch
	{
		[HarmonyPatch("Update()")]
		[HarmonyPostfix]
		private static void jesterPatch2(ref JesterAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
			__instance.maxAnimSpeed *= 10f;
		}

		[HarmonyPatch("DoAIInterval()")]
		[HarmonyPostfix]
		private static void jesterPatch(ref JesterAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}

		[HarmonyPatch("SetJesterInitialValues")]
		[HarmonyPostfix]
		private static void jesterPtach3(ref JesterAI __instance)
		{
			__instance.popUpTimer /= 10f;
			__instance.beginCrankingTimer /= 10f;
		}
	}
	[HarmonyPatch(typeof(HoarderBugAI))]
	internal class LootBugPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void lootBugPatch(ref HoarderBugAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(MaskedPlayerEnemy))]
	internal class MaskPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void maskPatch(ref MaskedPlayerEnemy __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(RadMechAI))]
	internal class MechPatch
	{
		[HarmonyPatch("DoFootstepCycle")]
		[HarmonyPostfix]
		private static void mechPatch(ref RadMechAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(MouthDogAI))]
	internal class MouthDogPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void mouthDogPatch(ref MouthDogAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(CaveDwellerAI))]
	internal class BabyPatch
	{
		[HarmonyPatch("DoBabyAIInterval")]
		[HarmonyPostfix]
		private static void babyPatch2(ref CaveDwellerAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}

		[HarmonyPatch("BabyUpdate")]
		[HarmonyPostfix]
		private static void babyPatch3(ref CaveDwellerAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}

		[HarmonyPatch("becomeAdultAnimation")]
		[HarmonyPostfix]
		private static void babyPatch4(ref CaveDwellerAI __instance)
		{
			__instance.leapSpeed *= 10f;
		}

		[HarmonyPatch("DoNonBabyUpdateLogic")]
		[HarmonyPostfix]
		private static void babyPatch5(ref CaveDwellerAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(NutcrackerEnemyAI))]
	internal class NutPatch
	{
		[HarmonyPatch("TurnTorsoToTargetDegrees")]
		[HarmonyPostfix]
		private static void nutPatch(ref NutcrackerEnemyAI __instance)
		{
			__instance.torsoTurnSpeed *= 10f;
		}

		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void nutPatch2(ref NutcrackerEnemyAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(PufferAI))]
	internal class PufferPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void pufPatch(ref PufferAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(FlowerSnakeEnemy))]
	internal class SnakePatch
	{
		[HarmonyPostfix]
		private static void snakePatch(ref FlowerSnakeEnemy __instance)
		{
			__instance.leapSpeedMultiplier *= 10f;
		}

		[HarmonyPatch("DoAIInterval")]
		[HarmonyPostfix]
		private static void snakePatch2(ref FlowerSnakeEnemy __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(SandSpiderAI))]
	internal class SpiderPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void spiPatch(ref SandSpiderAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
			__instance.spiderSpeed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
	[HarmonyPatch(typeof(CrawlerAI))]
	internal class ThumberPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void ThumbPatch(ref CrawlerAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}

		[HarmonyPatch("CalculateAgentSpeed")]
		[HarmonyPostfix]
		private static void ThumbPatch2(ref CrawlerAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
			__instance.SpeedAccelerationEffect *= 10f;
			__instance.SpeedIncreaseRate *= 10f;
		}
	}
	[HarmonyPatch(typeof(SandWormAI))]
	internal class WormPatch
	{
		[HarmonyPatch("DoAIInterval")]
		[HarmonyPostfix]
		private static void spiPatch(ref SandWormAI __instance)
		{
			((EnemyAI)__instance).agent.speed = ((EnemyAI)__instance).agent.speed * 10f;
		}
	}
}