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

removed scav encyclopedia patch as BSG does this now, few patches moved in plugin for testing

This commit is contained in:
CWX 2024-07-12 14:48:51 +01:00
parent 8cb788e4f0
commit f90ca3f780
2 changed files with 9 additions and 55 deletions

View File

@ -1,47 +0,0 @@
using SPT.Reflection.Patching;
using SPT.Reflection.Utils;
using SPT.SinglePlayer.Utils.InRaid;
using EFT;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace SPT.SinglePlayer.Patches.ScavMode
{
/**
* At the start of a scav raid, copy the PMC encyclopedia to the scav profile, and
* make sure the scav knows all of the items it has in its inventory
*/
internal class ScavEncyclopediaPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(GameWorld).GetMethod(nameof(GameWorld.OnGameStarted));
}
[PatchPostfix]
public static void PatchPostFix()
{
if (RaidChangesUtil.IsScavRaid)
{
var scavProfile = PatchConstants.BackEndSession.ProfileOfPet;
var pmcProfile = PatchConstants.BackEndSession.Profile;
// Handle old profiles where the scav doesn't have an encyclopedia
if (scavProfile.Encyclopedia == null)
{
scavProfile.Encyclopedia = new Dictionary<string, bool>();
}
// Sync the PMC encyclopedia to the scav profile
foreach (var item in pmcProfile.Encyclopedia.Where(item => !scavProfile.Encyclopedia.ContainsKey(item.Key)))
{
scavProfile.Encyclopedia.Add(item.Key, item.Value);
}
// Auto examine any items the scav doesn't know that are in their inventory
scavProfile.LearnAll();
}
}
}
}

View File

@ -28,26 +28,27 @@ namespace SPT.SinglePlayer
new HideoutQuestIgnorePatch().Enable(); new HideoutQuestIgnorePatch().Enable();
new SpawnProcessNegativeValuePatch().Enable(); new SpawnProcessNegativeValuePatch().Enable();
new SpawnPmcPatch().Enable(); new SpawnPmcPatch().Enable();
new ScavExperienceGainPatch().Enable(); // new ScavExperienceGainPatch().Enable();
new ScavEncyclopediaPatch().Enable(); // new ScavExfilPatch().Enable();
new ScavProfileLoadPatch().Enable(); // new ScavRepAdjustmentPatch().Enable();
new ScavPrefabLoadPatch().Enable(); // new ScavSellAllPriceStorePatch().Enable();
new ScavExfilPatch().Enable(); // new ScavSellAllRequestPatch().Enable();
// Still need // Still need
new ScavProfileLoadPatch().Enable();
new ScavPrefabLoadPatch().Enable();
new DisableReadyLocationReadyPatch().Enable(); new DisableReadyLocationReadyPatch().Enable();
new BotTemplateLimitPatch().Enable(); new BotTemplateLimitPatch().Enable();
new LoadOfflineRaidScreenPatch().Enable(); new LoadOfflineRaidScreenPatch().Enable();
new AmmoUsedCounterPatch().Enable(); new AmmoUsedCounterPatch().Enable();
new ArmorDamageCounterPatch().Enable(); new ArmorDamageCounterPatch().Enable();
new ScavRepAdjustmentPatch().Enable();
new PluginErrorNotifierPatch().Enable(); new PluginErrorNotifierPatch().Enable();
new GetNewBotTemplatesPatch().Enable(); new GetNewBotTemplatesPatch().Enable();
new LabsKeycardRemovalPatch().Enable(); new LabsKeycardRemovalPatch().Enable();
new MapReadyButtonPatch().Enable(); new MapReadyButtonPatch().Enable();
new RemoveUsedBotProfilePatch().Enable(); new RemoveUsedBotProfilePatch().Enable();
new ScavSellAllPriceStorePatch().Enable(); new ScavLateStartPatch().Enable();
new ScavSellAllRequestPatch().Enable();
// 3.10.0 // 3.10.0
new PVEModeWelcomeMessagePatch().Enable(); new PVEModeWelcomeMessagePatch().Enable();