diff --git a/project/Aki.Debugging/AkiDebuggingPlugin.cs b/project/Aki.Debugging/AkiDebuggingPlugin.cs index 442f110..68834ea 100644 --- a/project/Aki.Debugging/AkiDebuggingPlugin.cs +++ b/project/Aki.Debugging/AkiDebuggingPlugin.cs @@ -20,17 +20,16 @@ namespace Aki.Debugging { new EndRaidDebug().Enable(); new LoggerClassLogPatch().Enable(); - // new CoordinatesPatch().Enable(); + // new CoordinatesPatch().Enable(); // new StaticLootDumper().Enable(); // new ExfilDumper().Enable(); - // BTR debug command patches, can be disabled later - //new BTRDebugCommandPatch().Enable(); - //new BTRDebugDataPatch().Enable(); + // BTR debug command patches, can be disabled later + //new BTRDebugCommandPatch().Enable(); + //new BTRDebugDataPatch().Enable(); - //new PMCBotSpawnLocationPatch().Enable(); - // Chomp said to leave it enabled by default - new ReloadClientPatch().Enable(); + //new PMCBotSpawnLocationPatch().Enable(); + //new ReloadClientPatch().Enable(); } catch (Exception ex) { diff --git a/project/Aki.SinglePlayer/AkiSingleplayerPlugin.cs b/project/Aki.SinglePlayer/AkiSingleplayerPlugin.cs index 1891988..86cdb5b 100644 --- a/project/Aki.SinglePlayer/AkiSingleplayerPlugin.cs +++ b/project/Aki.SinglePlayer/AkiSingleplayerPlugin.cs @@ -66,6 +66,9 @@ namespace Aki.SinglePlayer new HideoutQuestIgnorePatch().Enable(); new LightKeeperServicesPatch().Enable(); new ScavEncyclopediaPatch().Enable(); + new ScavRepAdjustmentPatch().Enable(); + new AmmoUsedCounterPatch().Enable(); + new ArmorDamageCounterPatch().Enable(); } catch (Exception ex) { diff --git a/project/Aki.Debugging/Patches/Stats/AmmoUsedPatch.cs b/project/Aki.SinglePlayer/Patches/MainMenu/AmmoUsedCounterPatch.cs similarity index 83% rename from project/Aki.Debugging/Patches/Stats/AmmoUsedPatch.cs rename to project/Aki.SinglePlayer/Patches/MainMenu/AmmoUsedCounterPatch.cs index 4c7ee51..2833fc6 100644 --- a/project/Aki.Debugging/Patches/Stats/AmmoUsedPatch.cs +++ b/project/Aki.SinglePlayer/Patches/MainMenu/AmmoUsedCounterPatch.cs @@ -1,15 +1,12 @@ using Aki.Reflection.Patching; -using EFT.HealthSystem; using EFT; using HarmonyLib; -using System; -using System.Collections.Generic; using System.Reflection; 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; diff --git a/project/Aki.Debugging/Patches/Stats/ArmorDamagePatch.cs b/project/Aki.SinglePlayer/Patches/MainMenu/ArmorDamageCounterPatch.cs similarity index 90% rename from project/Aki.Debugging/Patches/Stats/ArmorDamagePatch.cs rename to project/Aki.SinglePlayer/Patches/MainMenu/ArmorDamageCounterPatch.cs index 3395b15..68b3b9f 100644 --- a/project/Aki.Debugging/Patches/Stats/ArmorDamagePatch.cs +++ b/project/Aki.SinglePlayer/Patches/MainMenu/ArmorDamageCounterPatch.cs @@ -5,9 +5,9 @@ using HarmonyLib; using System; 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() { diff --git a/project/Aki.SinglePlayer/Patches/ScavMode/ScavRepAdjustmentPatch.cs b/project/Aki.SinglePlayer/Patches/ScavMode/ScavRepAdjustmentPatch.cs new file mode 100644 index 0000000..c75c02d --- /dev/null +++ b/project/Aki.SinglePlayer/Patches/ScavMode/ScavRepAdjustmentPatch.cs @@ -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 __state) + { + var player = Singleton.Instance.MainPlayer; + __state = new Tuple(null, false); + + if (player.Profile.Side != EPlayerSide.Savage) + { + return; + } + + if (Singleton.Instance.GetEverExistedPlayerByID(playerProfileId) is Player killedPlayer) + { + __state = new Tuple(killedPlayer, killedPlayer.AIData.IsAI); + killedPlayer.AIData.IsAI = false; + player.Loyalty.method_1(killedPlayer); + } + } + [PatchPostfix] + private static void PatchPostfix(Tuple __state) + { + if(__state.Item1 != null) + { + __state.Item1.AIData.IsAI = __state.Item2; + } + } + } +}