2023-03-03 18:52:31 +00:00
|
|
|
|
using Aki.Reflection.Patching;
|
|
|
|
|
using Aki.SinglePlayer.Models.Progression;
|
|
|
|
|
using Comfort.Common;
|
|
|
|
|
using EFT;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
|
|
namespace Aki.SinglePlayer.Patches.Progression
|
|
|
|
|
{
|
|
|
|
|
public class LighthouseBridgePatch : ModulePatch
|
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
|
|
|
|
return typeof(GameWorld).GetMethod(nameof(GameWorld.OnGameStarted));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPostfix]
|
|
|
|
|
private static void PatchPostfix()
|
|
|
|
|
{
|
|
|
|
|
var gameWorld = Singleton<GameWorld>.Instance;
|
2023-10-10 10:58:33 +00:00
|
|
|
|
|
|
|
|
|
if (gameWorld == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (gameWorld.MainPlayer.Location.ToLower() != "lighthouse" || gameWorld.MainPlayer.Side == EPlayerSide.Savage)
|
2023-07-30 10:04:35 +01:00
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
2023-03-03 18:52:31 +00:00
|
|
|
|
|
|
|
|
|
gameWorld.GetOrAddComponent<LighthouseProgressionClass>();
|
2023-10-10 10:58:33 +00:00
|
|
|
|
}
|
2023-03-03 18:52:31 +00:00
|
|
|
|
}
|
|
|
|
|
}
|