mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 06:50:44 -05:00
38 lines
1.6 KiB
C#
38 lines
1.6 KiB
C#
using EFT;
|
|
|
|
namespace SPT.Custom.CustomAI
|
|
{
|
|
public static class AiHelpers
|
|
{
|
|
/// <summary>
|
|
/// Bot is a PMC when it has IsStreamerModeAvailable flagged and has a wildspawn type of 'pmcBEAR' or 'pmcUSEC'
|
|
/// </summary>
|
|
/// <param name="botRoleToCheck">Bots role</param>
|
|
/// <param name="___botOwner_0">Bot details</param>
|
|
/// <returns></returns>
|
|
public static bool BotIsSptPmc(WildSpawnType botRoleToCheck, BotOwner ___botOwner_0)
|
|
{
|
|
if (___botOwner_0.Profile.Info.IsStreamerModeAvailable)
|
|
{
|
|
// PMCs can sometimes have their role changed to 'assaultGroup' by the client, we need an alternate way to figure out if they're a spt pmc
|
|
return true;
|
|
}
|
|
|
|
return botRoleToCheck is WildSpawnType.pmcBEAR or WildSpawnType.pmcUSEC;
|
|
}
|
|
|
|
public static bool BotIsPlayerScav(WildSpawnType role, string nickname)
|
|
{
|
|
// Check bot is pscav by looking for the opening parentheses of their nickname e.g. scavname (pmc name)
|
|
return role == WildSpawnType.assault && nickname.Contains("(");
|
|
}
|
|
|
|
public static bool BotIsSimulatedPlayerScav(WildSpawnType role, BotOwner botOwner)
|
|
{
|
|
// Assault and has "(" character in name = simulated p scav
|
|
var nicknameContainsPScvCharacter = botOwner.Profile.Info.Nickname?.Contains("(");
|
|
return nicknameContainsPScvCharacter.HasValue && nicknameContainsPScvCharacter.Value && role == WildSpawnType.assault;
|
|
}
|
|
}
|
|
}
|