0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 01:50:45 -05:00

PMC's now heal fine by themselves, removing patch

This commit is contained in:
CWX 2024-08-02 17:40:56 +01:00
parent a39cd0a7b0
commit 99184be313
2 changed files with 0 additions and 62 deletions

View File

@ -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
{
/// <summary>
/// On pmc heal action, remove all negative effects from limbs e.g. light/heavy bleeds
/// Solves PMCs spending multiple minutes healing every limb
/// </summary>
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);
}
/// <summary>
/// BotFirstAidClass
/// </summary>
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
}
}
}

View File

@ -22,7 +22,6 @@ namespace SPT.Custom
new EasyBundlePatch().Enable(); new EasyBundlePatch().Enable();
// TODO: check if these patches are needed // TODO: check if these patches are needed
// new PmcTakesAgesToHealLimbsPatch().Enable();
new DisableNonHalloweenExitsDuringEventPatch().Enable(); new DisableNonHalloweenExitsDuringEventPatch().Enable();
// new AllScavsHostileHostileToPlayerScavPatch().Enable(); // new AllScavsHostileHostileToPlayerScavPatch().Enable();
// new CopyPmcQuestsToPlayerScavPatch().Enable(); // new CopyPmcQuestsToPlayerScavPatch().Enable();