2024-05-21 19:10:17 +01:00
|
|
|
|
using SPT.Reflection.Patching;
|
2023-03-03 18:52:31 +00:00
|
|
|
|
using Comfort.Common;
|
|
|
|
|
using EFT;
|
|
|
|
|
using System.Reflection;
|
2024-01-13 22:08:29 +00:00
|
|
|
|
using HarmonyLib;
|
2023-03-03 18:52:31 +00:00
|
|
|
|
|
2024-05-21 19:10:17 +01:00
|
|
|
|
namespace SPT.SinglePlayer.Patches.Progression
|
2023-03-03 18:52:31 +00:00
|
|
|
|
{
|
|
|
|
|
public class LighthouseTransmitterPatch : ModulePatch
|
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
2024-01-13 22:08:29 +00:00
|
|
|
|
return AccessTools.Method(typeof(RadioTransmitterHandlerClass), nameof(RadioTransmitterHandlerClass.method_4));
|
2023-03-03 18:52:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPrefix]
|
|
|
|
|
private static bool PatchPrefix(RadioTransmitterHandlerClass __instance)
|
|
|
|
|
{
|
|
|
|
|
var gameWorld = Singleton<GameWorld>.Instance;
|
|
|
|
|
|
|
|
|
|
if (gameWorld == null) return false;
|
|
|
|
|
|
|
|
|
|
var transmitter = __instance.RecodableComponent;
|
|
|
|
|
|
|
|
|
|
if (transmitter.IsEncoded)
|
|
|
|
|
{
|
|
|
|
|
transmitter.SetStatus(RadioTransmitterStatus.Green);
|
|
|
|
|
}
|
|
|
|
|
else if (gameWorld.MainPlayer.IsAgressorInLighthouseTraderZone)
|
|
|
|
|
{
|
|
|
|
|
// this might need to be tested and changed as I don't think this currently is affect upon killing bosses
|
|
|
|
|
transmitter.SetStatus(RadioTransmitterStatus.Yellow);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
transmitter.SetStatus(RadioTransmitterStatus.Red);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|