From 99184be3131155ec512bfa7b5f233ab93f8c7b50 Mon Sep 17 00:00:00 2001 From: CWX Date: Fri, 2 Aug 2024 17:40:56 +0100 Subject: [PATCH] PMC's now heal fine by themselves, removing patch --- .../Patches/PmcTakesAgesToHealLimbsPatch.cs | 61 ------------------- project/SPT.Custom/SPTCustomPlugin.cs | 1 - 2 files changed, 62 deletions(-) delete mode 100644 project/SPT.Custom/Patches/PmcTakesAgesToHealLimbsPatch.cs diff --git a/project/SPT.Custom/Patches/PmcTakesAgesToHealLimbsPatch.cs b/project/SPT.Custom/Patches/PmcTakesAgesToHealLimbsPatch.cs deleted file mode 100644 index 8da2058..0000000 --- a/project/SPT.Custom/Patches/PmcTakesAgesToHealLimbsPatch.cs +++ /dev/null @@ -1,61 +0,0 @@ -using SPT.Reflection.Patching; -using SPT.Reflection.Utils; -using EFT; -using System; -using System.Linq; -using System.Reflection; - -namespace SPT.Custom.Patches -{ - /// - /// On pmc heal action, remove all negative effects from limbs e.g. light/heavy bleeds - /// Solves PMCs spending multiple minutes healing every limb - /// - public class PmcTakesAgesToHealLimbsPatch : ModulePatch - { - private static Type _targetType; - private static readonly string methodName = "FirstAidApplied"; - - public PmcTakesAgesToHealLimbsPatch() - { - _targetType = PatchConstants.EftTypes.FirstOrDefault(IsTargetType); - } - - protected override MethodBase GetTargetMethod() - { - return _targetType.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public); - } - - /// - /// BotFirstAidClass - /// - private bool IsTargetType(Type type) - { - if (type.GetMethod("GetHpPercent") != null && type.GetMethod("TryApplyToCurrentPart") != null) - { - return true; - } - - return false; - } - - [PatchPrefix] - public static bool PatchPrefix(BotOwner ___botOwner_0) - { - if (___botOwner_0.IsRole(WildSpawnType.pmcUSEC) || ___botOwner_0.IsRole(WildSpawnType.pmcBEAR)) - { - var healthController = ___botOwner_0.GetPlayer.ActiveHealthController; - - healthController.RemoveNegativeEffects(EBodyPart.Head); - healthController.RemoveNegativeEffects(EBodyPart.Chest); - healthController.RemoveNegativeEffects(EBodyPart.Stomach); - healthController.RemoveNegativeEffects(EBodyPart.LeftLeg); - healthController.RemoveNegativeEffects(EBodyPart.RightLeg); - healthController.RemoveNegativeEffects(EBodyPart.LeftArm); - healthController.RemoveNegativeEffects(EBodyPart.RightArm); - } - - return true; // Do original - } - } -} diff --git a/project/SPT.Custom/SPTCustomPlugin.cs b/project/SPT.Custom/SPTCustomPlugin.cs index b84cb48..44c8380 100644 --- a/project/SPT.Custom/SPTCustomPlugin.cs +++ b/project/SPT.Custom/SPTCustomPlugin.cs @@ -22,7 +22,6 @@ namespace SPT.Custom new EasyBundlePatch().Enable(); // TODO: check if these patches are needed - // new PmcTakesAgesToHealLimbsPatch().Enable(); new DisableNonHalloweenExitsDuringEventPatch().Enable(); // new AllScavsHostileHostileToPlayerScavPatch().Enable(); // new CopyPmcQuestsToPlayerScavPatch().Enable();