mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 05:50:44 -05:00
32280
This commit is contained in:
parent
32b2136630
commit
8a0f088292
@ -22,7 +22,7 @@ git config --local user.email "USERNAME@SOMETHING.com"
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
- Escape From Tarkov 32197
|
- Escape From Tarkov 32280
|
||||||
- Visual Studio Code -OR- Visual Studio 2022
|
- Visual Studio Code -OR- Visual Studio 2022
|
||||||
- .NET 6 SDK
|
- .NET 6 SDK
|
||||||
- [PowerShell v7](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows)
|
- [PowerShell v7](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows)
|
||||||
|
@ -14,7 +14,7 @@ namespace SPT.Debugging.Patches
|
|||||||
// TODO: Instantiation of this is fairly slow, need to find best way to cache it
|
// TODO: Instantiation of this is fairly slow, need to find best way to cache it
|
||||||
public class SptSpawnHelper
|
public class SptSpawnHelper
|
||||||
{
|
{
|
||||||
private readonly List<ISpawnPoint> playerSpawnPoints;
|
private readonly List<ISpawnPoint> _playerSpawnPoints;
|
||||||
private readonly Random _rnd = new Random();
|
private readonly Random _rnd = new Random();
|
||||||
//private readonly GStruct381 _spawnSettings = new GStruct381();
|
//private readonly GStruct381 _spawnSettings = new GStruct381();
|
||||||
|
|
||||||
@ -23,12 +23,12 @@ namespace SPT.Debugging.Patches
|
|||||||
IEnumerable<ISpawnPoint> locationSpawnPoints = SpawnPointManagerClass.CreateFromScene();
|
IEnumerable<ISpawnPoint> locationSpawnPoints = SpawnPointManagerClass.CreateFromScene();
|
||||||
|
|
||||||
var playerSpawns = locationSpawnPoints.Where(x => x.Categories.HasFlag(ESpawnCategoryMask.Player)).ToList();
|
var playerSpawns = locationSpawnPoints.Where(x => x.Categories.HasFlag(ESpawnCategoryMask.Player)).ToList();
|
||||||
this.playerSpawnPoints = locationSpawnPoints.Where(x => x.Categories.HasFlag(ESpawnCategoryMask.Player)).ToList();
|
this._playerSpawnPoints = locationSpawnPoints.Where(x => x.Categories.HasFlag(ESpawnCategoryMask.Player)).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PrintSpawnPoints()
|
public void PrintSpawnPoints()
|
||||||
{
|
{
|
||||||
foreach (var spawnPoint in playerSpawnPoints)
|
foreach (var spawnPoint in _playerSpawnPoints)
|
||||||
{
|
{
|
||||||
ConsoleScreen.Log("[SPT PMC Bot spawn] Spawn point " + spawnPoint.Id + " location is " + spawnPoint.Position.ToString());
|
ConsoleScreen.Log("[SPT PMC Bot spawn] Spawn point " + spawnPoint.Id + " location is " + spawnPoint.Position.ToString());
|
||||||
}
|
}
|
||||||
@ -37,18 +37,18 @@ namespace SPT.Debugging.Patches
|
|||||||
public ISpawnPoint SelectSpawnPoint()
|
public ISpawnPoint SelectSpawnPoint()
|
||||||
{
|
{
|
||||||
// TODO: Select spawn points more intelligently
|
// TODO: Select spawn points more intelligently
|
||||||
return this.playerSpawnPoints[_rnd.Next(this.playerSpawnPoints.Count)];
|
return this._playerSpawnPoints[_rnd.Next(this._playerSpawnPoints.Count)];
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ISpawnPoint> SelectSpawnPoints(int count)
|
public List<ISpawnPoint> SelectSpawnPoints(int count)
|
||||||
{
|
{
|
||||||
// TODO: Fine-grained spawn selection
|
// TODO: Fine-grained spawn selection
|
||||||
if (count > this.playerSpawnPoints.Count())
|
if (count > this._playerSpawnPoints.Count())
|
||||||
{
|
{
|
||||||
ConsoleScreen.Log($"[SPT PMC Bot spawn] Wanted ${count} but only {this.playerSpawnPoints.Count()} found, returning all");
|
ConsoleScreen.Log($"[SPT PMC Bot spawn] Wanted ${count} but only {this._playerSpawnPoints.Count()} found, returning all");
|
||||||
return this.playerSpawnPoints;
|
return this._playerSpawnPoints;
|
||||||
}
|
}
|
||||||
return this.playerSpawnPoints.OrderBy(x => _rnd.Next()).Take(count).ToList();
|
return this._playerSpawnPoints.OrderBy(x => _rnd.Next()).Take(count).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ namespace SPT.Debugging.Patches
|
|||||||
}
|
}
|
||||||
|
|
||||||
[PatchPrefix]
|
[PatchPrefix]
|
||||||
public static bool PatchPrefix(GClass1574 __instance, BotCreationDataClass data)
|
public static bool PatchPrefix(GClass1575 __instance, BotCreationDataClass data)
|
||||||
{
|
{
|
||||||
var firstBotRole = data.Profiles[0].Info.Settings.Role;
|
var firstBotRole = data.Profiles[0].Info.Settings.Role;
|
||||||
if (firstBotRole != WildSpawnType.pmcBEAR || firstBotRole != WildSpawnType.pmcUSEC)
|
if (firstBotRole != WildSpawnType.pmcBEAR || firstBotRole != WildSpawnType.pmcUSEC)
|
||||||
|
@ -12,7 +12,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
|||||||
{
|
{
|
||||||
protected override MethodBase GetTargetMethod()
|
protected override MethodBase GetTargetMethod()
|
||||||
{
|
{
|
||||||
return AccessTools.Method(typeof(MerchantsList.Class2759), nameof(MerchantsList.Class2759.method_0));
|
return AccessTools.Method(typeof(MerchantsList.Class2758), nameof(MerchantsList.Class2758.method_0));
|
||||||
}
|
}
|
||||||
|
|
||||||
[PatchPrefix]
|
[PatchPrefix]
|
||||||
|
@ -8,7 +8,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
|||||||
{
|
{
|
||||||
protected override MethodBase GetTargetMethod()
|
protected override MethodBase GetTargetMethod()
|
||||||
{
|
{
|
||||||
return AccessTools.Method(typeof(GClass1925), nameof(GClass1925.GetBoolForProfile));
|
return AccessTools.Method(typeof(GClass1926), nameof(GClass1926.GetBoolForProfile));
|
||||||
}
|
}
|
||||||
|
|
||||||
[PatchPrefix]
|
[PatchPrefix]
|
||||||
|
@ -15,7 +15,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
|||||||
}
|
}
|
||||||
|
|
||||||
[PatchPrefix]
|
[PatchPrefix]
|
||||||
private static void Prefix(ref ClothingItem.GClass3338 offer)
|
private static void Prefix(ref ClothingItem.GClass3339 offer)
|
||||||
{
|
{
|
||||||
offer.Offer.ExternalObtain = false;
|
offer.Offer.ExternalObtain = false;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user