mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
Reduced patch complexity and rename
This commit is contained in:
parent
b4c699bd40
commit
60ccc54220
@ -0,0 +1,30 @@
|
|||||||
|
using SPT.Reflection.Patching;
|
||||||
|
using System.Reflection;
|
||||||
|
using HarmonyLib;
|
||||||
|
|
||||||
|
namespace SPT.Custom.Patches
|
||||||
|
{
|
||||||
|
public class BotsGroupLetBossesShootPmcsPatch : ModulePatch
|
||||||
|
{
|
||||||
|
protected override MethodBase GetTargetMethod()
|
||||||
|
{
|
||||||
|
return AccessTools.Method(typeof(BotsGroup), nameof(BotsGroup.CheckAndAddEnemy));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// CheckAndAddEnemy()
|
||||||
|
/// Goal: This patch lets bosses shoot back once a PMC has shot them
|
||||||
|
/// Force method to always run the code
|
||||||
|
/// </summary>
|
||||||
|
[PatchPrefix]
|
||||||
|
private static bool PatchPrefix(ref bool ignoreAI)
|
||||||
|
{
|
||||||
|
// original
|
||||||
|
// return player.HealthController.IsAlive && (!player.AIData.IsAI || ignoreAI) && !this.Enemies.ContainsKey(player) && this.AddEnemy(player, EBotEnemyCause.checkAddTODO);
|
||||||
|
ignoreAI = true;
|
||||||
|
|
||||||
|
|
||||||
|
return true; // Do Original
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,29 +0,0 @@
|
|||||||
using SPT.Reflection.Patching;
|
|
||||||
using EFT;
|
|
||||||
using System.Reflection;
|
|
||||||
using HarmonyLib;
|
|
||||||
|
|
||||||
namespace SPT.Custom.Patches
|
|
||||||
{
|
|
||||||
public class CheckAndAddEnemyPatch : ModulePatch
|
|
||||||
{
|
|
||||||
protected override MethodBase GetTargetMethod()
|
|
||||||
{
|
|
||||||
return AccessTools.Method(typeof(BotsGroup), nameof(BotsGroup.CheckAndAddEnemy));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// CheckAndAddEnemy()
|
|
||||||
/// Goal: This patch lets bosses shoot back once a PMC has shot them
|
|
||||||
/// Removes the !player.AIData.IsAI check
|
|
||||||
/// BSG changed the way CheckAndAddEnemy Works in 14.0 Returns a bool now
|
|
||||||
/// </summary>
|
|
||||||
[PatchPrefix]
|
|
||||||
private static bool PatchPrefix(BotsGroup __instance, IPlayer player, ref bool __result)
|
|
||||||
{
|
|
||||||
// Set result to not include !player.AIData.IsAI checks
|
|
||||||
__result = player.HealthController.IsAlive && !__instance.Enemies.ContainsKey(player) && __instance.AddEnemy(player, EBotEnemyCause.checkAddTODO);
|
|
||||||
return false; // Skip Original
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -26,7 +26,7 @@ namespace SPT.Custom
|
|||||||
new BotCalledDataTryCallPatch().Enable();
|
new BotCalledDataTryCallPatch().Enable();
|
||||||
new BotCallForHelpCallBotPatch().Enable();
|
new BotCallForHelpCallBotPatch().Enable();
|
||||||
new BotOwnerDisposePatch().Enable();
|
new BotOwnerDisposePatch().Enable();
|
||||||
new CheckAndAddEnemyPatch().Enable();
|
new BotsGroupLetBossesShootPmcsPatch().Enable();
|
||||||
new AddEnemyToAllGroupsInBotZonePatch().Enable();
|
new AddEnemyToAllGroupsInBotZonePatch().Enable();
|
||||||
new CustomAiPatch().Enable();
|
new CustomAiPatch().Enable();
|
||||||
new AddTraitorScavsPatch().Enable();
|
new AddTraitorScavsPatch().Enable();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user