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

Add Patches to add extra data to end of raid screen

This commit is contained in:
Kaeno 2024-03-21 15:21:57 +00:00
parent 3885b9e585
commit c29589768d
5 changed files with 58 additions and 14 deletions

View File

@ -20,17 +20,16 @@ namespace Aki.Debugging
{ {
new EndRaidDebug().Enable(); new EndRaidDebug().Enable();
new LoggerClassLogPatch().Enable(); new LoggerClassLogPatch().Enable();
// new CoordinatesPatch().Enable(); // new CoordinatesPatch().Enable();
// new StaticLootDumper().Enable(); // new StaticLootDumper().Enable();
// new ExfilDumper().Enable(); // new ExfilDumper().Enable();
// BTR debug command patches, can be disabled later // BTR debug command patches, can be disabled later
//new BTRDebugCommandPatch().Enable(); //new BTRDebugCommandPatch().Enable();
//new BTRDebugDataPatch().Enable(); //new BTRDebugDataPatch().Enable();
//new PMCBotSpawnLocationPatch().Enable(); //new PMCBotSpawnLocationPatch().Enable();
// Chomp said to leave it enabled by default //new ReloadClientPatch().Enable();
new ReloadClientPatch().Enable();
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -66,6 +66,9 @@ namespace Aki.SinglePlayer
new HideoutQuestIgnorePatch().Enable(); new HideoutQuestIgnorePatch().Enable();
new LightKeeperServicesPatch().Enable(); new LightKeeperServicesPatch().Enable();
new ScavEncyclopediaPatch().Enable(); new ScavEncyclopediaPatch().Enable();
new ScavRepAdjustmentPatch().Enable();
new AmmoUsedCounterPatch().Enable();
new ArmorDamageCounterPatch().Enable();
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -1,15 +1,12 @@
using Aki.Reflection.Patching; using Aki.Reflection.Patching;
using EFT.HealthSystem;
using EFT; using EFT;
using HarmonyLib; using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using Comfort.Common; using Comfort.Common;
namespace Aki.Debugging.Patches.Stats namespace Aki.SinglePlayer.Patches.MainMenu
{ {
public class AmmoUsedPatch : ModulePatch public class AmmoUsedCounterPatch : ModulePatch
{ {
private static Player player; private static Player player;

View File

@ -5,9 +5,9 @@ using HarmonyLib;
using System; using System;
using System.Reflection; using System.Reflection;
namespace Aki.Debugging.Patches.Stats namespace Aki.SinglePlayer.Patches.MainMenu
{ {
public class ArmorDamagePatch : ModulePatch public class ArmorDamageCounterPatch : ModulePatch
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {

View File

@ -0,0 +1,45 @@
using Aki.Reflection.Patching;
using Comfort.Common;
using EFT;
using HarmonyLib;
using System;
using System.Reflection;
namespace Aki.SinglePlayer.Patches.ScavMode
{
public class ScavRepAdjustmentPatch : ModulePatch
{
// TODO: REMAP/UPDATE GCLASS REF
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(GClass1790), nameof(GClass1790.OnEnemyKill));
}
[PatchPrefix]
private static void PatchPrefix(string playerProfileId, out Tuple<Player, bool> __state)
{
var player = Singleton<GameWorld>.Instance.MainPlayer;
__state = new Tuple<Player, bool>(null, false);
if (player.Profile.Side != EPlayerSide.Savage)
{
return;
}
if (Singleton<GameWorld>.Instance.GetEverExistedPlayerByID(playerProfileId) is Player killedPlayer)
{
__state = new Tuple<Player, bool>(killedPlayer, killedPlayer.AIData.IsAI);
killedPlayer.AIData.IsAI = false;
player.Loyalty.method_1(killedPlayer);
}
}
[PatchPostfix]
private static void PatchPostfix(Tuple<Player, bool> __state)
{
if(__state.Item1 != null)
{
__state.Item1.AIData.IsAI = __state.Item2;
}
}
}
}