diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ca16518 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.zip +.vs/ +ValensHasThePower/bin/ +ValensHasThePower/obj/ \ No newline at end of file diff --git a/ValensHasThePower/Patches.cs b/ValensHasThePower/Patches.cs new file mode 100644 index 0000000..afeeb92 --- /dev/null +++ b/ValensHasThePower/Patches.cs @@ -0,0 +1,24 @@ +using System.Reflection; +using Aki.Reflection.Patching; +using Aki.Reflection.Utils; +using EFT; + +namespace ValensHasThePower +{ + public class PatchThePower : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + var result = typeof(MainApplication).GetMethod("method_41", PatchConstants.PrivateFlags); + + return result; + } + + [PatchPostfix] + private static void PatchPostFix() + { + PowerOn.Start(); + + } + } +} \ No newline at end of file diff --git a/ValensHasThePower/Program.cs b/ValensHasThePower/Program.cs new file mode 100644 index 0000000..1a103ee --- /dev/null +++ b/ValensHasThePower/Program.cs @@ -0,0 +1,58 @@ +using BepInEx; +using UnityEngine; +using EFT.Interactive; +using System.Linq; + +namespace ValensHasThePower +{ + [BepInPlugin("com.Valens.HasThePower", "ValensHasThePower", "1.0.0")] + public class Plugin : BaseUnityPlugin + { + private void Awake() + { + Logger.LogInfo($"Valens...now has the POWER!!!"); + new PatchThePower().Enable(); + } + } + + public class PowerOn + { + public static void Start() + { + var power = GameObject.FindObjectsOfType().ToList(); + + foreach (var Switch in power) // Turn the Power Station switch to On. + { + //Interchange - Power to Mall + if (Switch.Id == "Shopping_Mall_DesignStuff_00055"&&Switch.name == "reserve_electric_switcher_lever") + { + Switch.DoorState = EDoorState.Open; + Debug.LogError(Switch.name); + } + //Activation of Toilet Key Card Reader in Burger Stop + if (Switch.name == "Node_Keycard_Saferoom") + { + Switch.DoorState = EDoorState.Open; + } + //Activation of OBJ21 Container + if (Switch.Id == "Shopping_Mall_DesignStuff_00061"&&Switch.Id == "reserve_electric_switcher_lever") + { + Switch.DoorState = EDoorState.Open; + } + + //Customs - Power to ZB-013 Extract. + if (Switch.Id == "custom_DesignStuff_00034"&&Switch.name == "reserve_electric_switcher_lever") + { + Switch.DoorState = EDoorState.Open; + } + + if (Switch.ExfiltrationPoint == "EXFIL_ZONE_ZB013") + { + Switch.ExfiltrationPoint.Status = ?? + } + + //Reserve + } + } + } +} \ No newline at end of file diff --git a/ValensHasThePower/ValensHasThePower.csproj b/ValensHasThePower/ValensHasThePower.csproj new file mode 100644 index 0000000..b734b4e --- /dev/null +++ b/ValensHasThePower/ValensHasThePower.csproj @@ -0,0 +1,28 @@ + + + + net472 + + + + + H:\SP Tarkov\EFT (2.3)\EscapeFromTarkov_Data\Managed\Aki.Common.dll + + + H:\SP Tarkov\EFT (2.3)\EscapeFromTarkov_Data\Managed\Aki.Reflection.dll + + + H:\SP Tarkov\EFT (2.3)\EscapeFromTarkov_Data\Managed\Assembly-CSharp.dll + + + H:\SP Tarkov\EFT (2.3)\BepInEx\core\BepInEx.dll + + + H:\SP Tarkov\EFT (2.3)\EscapeFromTarkov_Data\Managed\UnityEngine.dll + + + H:\SP Tarkov\EFT (2.3)\EscapeFromTarkov_Data\Managed\UnityEngine.CoreModule.dll + + + + diff --git a/ValensHasThePower/ValensHasThePower.sln b/ValensHasThePower/ValensHasThePower.sln new file mode 100644 index 0000000..08ff5a4 --- /dev/null +++ b/ValensHasThePower/ValensHasThePower.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32228.430 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ValensHasThePower", "ValensHasThePower.csproj", "{570E1C73-2B17-4FE0-B476-23BEA636E293}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {570E1C73-2B17-4FE0-B476-23BEA636E293}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {570E1C73-2B17-4FE0-B476-23BEA636E293}.Debug|Any CPU.Build.0 = Debug|Any CPU + {570E1C73-2B17-4FE0-B476-23BEA636E293}.Release|Any CPU.ActiveCfg = Release|Any CPU + {570E1C73-2B17-4FE0-B476-23BEA636E293}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {705DD5E9-5B56-4E61-8E01-F1E6DE66E98A} + EndGlobalSection +EndGlobal