2024-05-21 19:10:17 +01:00
|
|
|
|
using SPT.Reflection.Patching;
|
2024-03-21 11:04:53 +00:00
|
|
|
|
using EFT;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
2024-05-21 19:10:17 +01:00
|
|
|
|
namespace SPT.SinglePlayer.Patches.MainMenu
|
2024-03-21 11:04:53 +00:00
|
|
|
|
{
|
2024-03-21 15:21:57 +00:00
|
|
|
|
public class AmmoUsedCounterPatch : ModulePatch
|
2024-03-21 11:04:53 +00:00
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
2024-03-22 18:45:49 +00:00
|
|
|
|
return AccessTools.Method(typeof(Player), nameof(Player.OnMakingShot));
|
2024-03-21 11:04:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPostfix]
|
2024-08-02 16:57:59 +01:00
|
|
|
|
public static void PatchPostfix(Player __instance)
|
2024-03-21 11:04:53 +00:00
|
|
|
|
{
|
2024-03-22 18:45:49 +00:00
|
|
|
|
if (__instance.IsYourPlayer)
|
|
|
|
|
{
|
|
|
|
|
__instance.Profile.EftStats.SessionCounters.AddLong(1L, SessionCounterTypesAbstractClass.AmmoUsed);
|
|
|
|
|
}
|
2024-03-21 11:04:53 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|