Skip to content

Commit 26729aa

Browse files
committed
- Update for 3.9.0
- Target the proper framework version - Bump to 1.0.0 because it's been stable enough for a while now to be considered out of beta
1 parent eb10fbd commit 26729aa

12 files changed

+26
-28
lines changed

BigBrainPlugin.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
namespace DrakiaXYZ.BigBrain
77
{
8-
[BepInPlugin("xyz.drakia.bigbrain", "DrakiaXYZ-BigBrain", "0.4.0.0")]
9-
[BepInDependency("com.spt-aki.core", "3.8.0")]
8+
[BepInPlugin("xyz.drakia.bigbrain", "DrakiaXYZ-BigBrain", "1.0.0")]
9+
[BepInDependency("com.SPT.core", "3.9.0")]
1010
internal class BigBrainPlugin : BaseUnityPlugin
1111
{
1212
private void Awake()

Brains/BrainManager.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ internal static BrainManager Instance
3636
internal List<Type> CustomLogicList = new List<Type>();
3737
internal List<ExcludeLayerInfo> ExcludeLayers = new List<ExcludeLayerInfo>();
3838

39-
private static FieldInfo _strategyField = Utils.GetFieldByType(typeof(AICoreLogicAgentClass), typeof(AICoreStrategyClass<>));
39+
private static FieldInfo _strategyField = Utils.GetFieldByType(typeof(AICoreLogicAgentClass), typeof(AICoreStrategyAbstractClass<>));
4040

4141
// Hide the constructor so we can have this as a guaranteed singleton
4242
private BrainManager() { }
@@ -155,7 +155,7 @@ public static object GetActiveLogic(BotOwner botOwner)
155155
return null;
156156
}
157157

158-
BaseNodeClass activeLogic = CustomLayerWrapper.GetLogicInstance(botOwner);
158+
BaseNodeAbstractClass activeLogic = CustomLayerWrapper.GetLogicInstance(botOwner);
159159
if (activeLogic is CustomLogicWrapper customLogicWrapper)
160160
{
161161
return customLogicWrapper.CustomLogic();

DrakiaXYZ-BigBrain.csproj

+6-8
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>DrakiaXYZ.BigBrain</RootNamespace>
1111
<AssemblyName>DrakiaXYZ-BigBrain</AssemblyName>
12-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<Deterministic>true</Deterministic>
15+
<TargetFrameworkProfile />
1516
</PropertyGroup>
1617
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1718
<DebugSymbols>true</DebugSymbols>
@@ -34,14 +35,11 @@
3435
<Reference Include="0Harmony">
3536
<HintPath>..\..\BepInEx\core\0Harmony.dll</HintPath>
3637
</Reference>
37-
<Reference Include="Aki.Build">
38-
<HintPath>..\..\EscapeFromTarkov_Data\Managed\Aki.Build.dll</HintPath>
38+
<Reference Include="spt-common">
39+
<HintPath>..\..\BepInEx\plugins\spt\spt-common.dll</HintPath>
3940
</Reference>
40-
<Reference Include="Aki.Common">
41-
<HintPath>..\..\EscapeFromTarkov_Data\Managed\Aki.Common.dll</HintPath>
42-
</Reference>
43-
<Reference Include="Aki.Reflection">
44-
<HintPath>..\..\EscapeFromTarkov_Data\Managed\Aki.Reflection.dll</HintPath>
41+
<Reference Include="spt-reflection">
42+
<HintPath>..\..\BepInEx\plugins\spt\spt-reflection.dll</HintPath>
4543
</Reference>
4644
<Reference Include="Assembly-CSharp">
4745
<HintPath>..\..\EscapeFromTarkov_Data\Managed\Assembly-CSharp.dll</HintPath>

Internal/CustomLayerWrapper.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace DrakiaXYZ.BigBrain.Internal
1313
{
14-
internal class CustomLayerWrapper : BaseLogicLayerSimpleClass
14+
internal class CustomLayerWrapper : BaseLogicLayerSimpleAbstractClass
1515
{
1616
private static FieldInfo _logicInstanceDictField = null;
1717

@@ -109,7 +109,7 @@ private void StopCurrentLogic()
109109
}
110110
}
111111

112-
static internal BaseNodeClass GetLogicInstance(BotOwner botOwner)
112+
static internal BaseNodeAbstractClass GetLogicInstance(BotOwner botOwner)
113113
{
114114
// Sanity check
115115
if (botOwner == null || botOwner.Brain?.Agent == null)
@@ -125,7 +125,7 @@ static internal BaseNodeClass GetLogicInstance(BotOwner botOwner)
125125

126126
BotLogicDecision logicDecision = botOwner.Brain.Agent.LastResult().Action;
127127
var aiCoreNodeDict = _logicInstanceDictField.GetValue(botOwner.Brain.Agent) as IDictionary;
128-
return aiCoreNodeDict[logicDecision] as BaseNodeClass;
128+
return aiCoreNodeDict[logicDecision] as BaseNodeAbstractClass;
129129
}
130130

131131
internal CustomLayer CustomLayer()

Internal/CustomLogicWrapper.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace DrakiaXYZ.BigBrain.Internal
66
{
7-
internal class CustomLogicWrapper : BaseNodeClass
7+
internal class CustomLogicWrapper : BaseNodeAbstractClass
88
{
99
private CustomLogic customLogic;
1010

Patches/BotAgentUpdatePatch.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Aki.Reflection.Patching;
1+
using SPT.Reflection.Patching;
22
using DrakiaXYZ.BigBrain.Internal;
33
using HarmonyLib;
44
using System;
@@ -24,7 +24,7 @@ protected override MethodBase GetTargetMethod()
2424
{
2525
Type botAgentType = typeof(AICoreLogicAgentClass);
2626

27-
_strategyField = Utils.GetFieldByType(botAgentType, typeof(AICoreStrategyClass<>));
27+
_strategyField = Utils.GetFieldByType(botAgentType, typeof(AICoreStrategyAbstractClass<>));
2828
_lastResultField = Utils.GetFieldByType(botAgentType, typeof(AILogicActionResultStruct));
2929
_logicInstanceDictField = Utils.GetFieldByType(botAgentType, typeof(IDictionary));
3030
_lazyGetterField = Utils.GetFieldByType(botAgentType, typeof(Delegate));
@@ -53,11 +53,11 @@ public static bool PatchPrefix(object __instance)
5353
{
5454
// If an instance of our action doesn't exist in our dict, add it
5555
int action = (int)result.Value.Action;
56-
BaseNodeClass nodeInstance = aiCoreNodeDict[(BotLogicDecision)action] as BaseNodeClass;
56+
BaseNodeAbstractClass nodeInstance = aiCoreNodeDict[(BotLogicDecision)action] as BaseNodeAbstractClass;
5757
if (nodeInstance == null)
5858
{
5959
Delegate lazyGetter = _lazyGetterField.GetValue(__instance) as Delegate;
60-
nodeInstance = lazyGetter.DynamicInvoke(new object[] { (BotLogicDecision)action }) as BaseNodeClass;
60+
nodeInstance = lazyGetter.DynamicInvoke(new object[] { (BotLogicDecision)action }) as BaseNodeAbstractClass;
6161

6262
if (nodeInstance != null)
6363
{

Patches/BotBaseBrainActivateLayerPatch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Aki.Reflection.Patching;
1+
using SPT.Reflection.Patching;
22
using DrakiaXYZ.BigBrain.Internal;
33
using HarmonyLib;
44
using System;

Patches/BotBaseBrainActivatePatch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Aki.Reflection.Patching;
1+
using SPT.Reflection.Patching;
22
using DrakiaXYZ.BigBrain.Brains;
33
using DrakiaXYZ.BigBrain.Internal;
44
using EFT;

Patches/BotBaseBrainAddLayerPatch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Aki.Reflection.Patching;
1+
using SPT.Reflection.Patching;
22
using DrakiaXYZ.BigBrain.Brains;
33
using HarmonyLib;
44
using System;

Patches/BotBaseBrainUpdatePatch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Aki.Reflection.Patching;
1+
using SPT.Reflection.Patching;
22
using DrakiaXYZ.BigBrain.Internal;
33
using EFT;
44
using HarmonyLib;

Patches/BotBrainCreateLogicNodePatch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Aki.Reflection.Patching;
1+
using SPT.Reflection.Patching;
22
using DrakiaXYZ.BigBrain.Brains;
33
using DrakiaXYZ.BigBrain.Internal;
44
using EFT;

Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
// You can specify all the values or you can default the Build and Revision Numbers
3434
// by using the '*' as shown below:
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("0.4.0.0")]
37-
[assembly: AssemblyFileVersion("0.4.0.0")]
38-
[assembly: TarkovVersion(29197)]
36+
[assembly: AssemblyVersion("1.0.0.0")]
37+
[assembly: AssemblyFileVersion("1.0.0.0")]
38+
[assembly: TarkovVersion(30626)]

0 commit comments

Comments
 (0)