diff --git a/BloonsTD6 Mod Helper/LATEST.md b/BloonsTD6 Mod Helper/LATEST.md index 90a48ac09..287daf689 100644 --- a/BloonsTD6 Mod Helper/LATEST.md +++ b/BloonsTD6 Mod Helper/LATEST.md @@ -1,2 +1 @@ -- Fixed ApplyOutlineShader -- Updated UpgradeTypes and VanillaSprites enums for Mermonkey \ No newline at end of file +- Removed a no longer needed patch that had side effects with X/3+/X Mermonkey damage calculations \ No newline at end of file diff --git a/BloonsTD6 Mod Helper/ModHelper.cs b/BloonsTD6 Mod Helper/ModHelper.cs index 12baa1ea0..51325fa5a 100644 --- a/BloonsTD6 Mod Helper/ModHelper.cs +++ b/BloonsTD6 Mod Helper/ModHelper.cs @@ -16,7 +16,7 @@ namespace BTD_Mod_Helper; public static class ModHelper { internal const string Name = "BloonsTD6 Mod Helper"; - internal const string Version = "3.1.23"; + internal const string Version = "3.1.24"; internal const string RepoOwner = "gurrenm3"; internal const string RepoName = "BTD-Mod-Helper"; internal const string Description = diff --git a/BloonsTD6 Mod Helper/Patches/Sim/Damage_Collide.cs b/BloonsTD6 Mod Helper/Patches/Sim/Damage_Collide.cs deleted file mode 100644 index ac6d0a270..000000000 --- a/BloonsTD6 Mod Helper/Patches/Sim/Damage_Collide.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Il2CppAssets.Scripts.Models.Towers.Projectiles; -using Il2CppAssets.Scripts.Simulation.Bloons; -using Il2CppAssets.Scripts.Simulation.Towers.Projectiles.Behaviors; -namespace BTD_Mod_Helper.Patches.Sim; - -/// -/// A reimplementation of this method in a way that actually takes into account the multiplier fields of damage models -/// -[HarmonyPatch(typeof(Damage), nameof(Damage.Collide))] -internal static class Damage_Collide -{ - [HarmonyPrefix] - private static bool Prefix(Damage __instance, Bloon bloon) - { - var projectileModel = __instance.projectile.projectileModel; - - if (!projectileModel.hasDamageModifiers) return true; - - var damageModel = __instance.damageModel; - - var totalAdd = 0f; - var totalMult = 1f; - var addOverMax = 0f; - var multOverMax = 1f; - - var search = __instance.entity.GetBehaviorsFast(); - var enumerator = search.GetEnumerator(); - while (enumerator.MoveNext()) - { - var damageModifier = enumerator.found.Cast(); - - var add = damageModifier.GetDamageAdditive(bloon); - - var mult = 1f; - - if (damageModifier.model.Is(out DamageModifierModel damageModifierModel)) - { - mult = damageModifierModel.GetDamageMult(bloon); - if (mult <= 0) - { - mult = 1; - } - } - - if (damageModifier.GetMaxDamageOverride()) - { - addOverMax += add; - multOverMax *= mult; - } - else - { - totalAdd += add; - totalMult *= mult; - } - } - search.Dispose(); - - var total = (damageModel.CapDamage((damageModel.damage + totalAdd) * totalMult) + addOverMax) * multOverMax; - - bloon.Damage(total, __instance.projectile, damageModel.distributeToChildren, - damageModel.overrideDistributeBlocker, damageModel.createPopEffect, __instance.projectile.emittedBy, - damageModel.immuneBloonProperties, true, projectileModel.ignoreNonTargetable); - - return false; - } -} \ No newline at end of file