2024-07-04 14:11:11 +00:00
|
|
|
|
using EFT;
|
2023-10-10 10:58:33 +00:00
|
|
|
|
|
2024-05-21 19:10:17 +01:00
|
|
|
|
namespace SPT.Custom.CustomAI
|
2023-10-10 10:58:33 +00:00
|
|
|
|
{
|
|
|
|
|
public static class AiHelpers
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2024-06-06 16:59:53 +00:00
|
|
|
|
/// Bot is a PMC when it has IsStreamerModeAvailable flagged and has a wildspawn type of 'pmcBEAR' or 'pmcUSEC'
|
2023-10-10 10:58:33 +00:00
|
|
|
|
/// </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)
|
|
|
|
|
{
|
2024-09-16 15:02:51 +01:00
|
|
|
|
// 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
|
2023-10-10 10:58:33 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-03 10:29:33 +01:00
|
|
|
|
return botRoleToCheck is WildSpawnType.pmcBEAR or WildSpawnType.pmcUSEC;
|
2023-10-10 10:58:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-02-11 10:33:59 +00:00
|
|
|
|
public static bool BotIsPlayerScav(WildSpawnType role, string nickname)
|
2023-10-10 10:58:33 +00:00
|
|
|
|
{
|
2024-10-03 10:29:33 +01:00
|
|
|
|
// Check bot is pscav by looking for the opening parentheses of their nickname e.g. scavname (pmc name)
|
|
|
|
|
return role == WildSpawnType.assault && nickname.Contains("(");
|
2023-10-10 10:58:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-09-16 12:13:12 +01:00
|
|
|
|
public static bool BotIsSimulatedPlayerScav(WildSpawnType role, BotOwner botOwner)
|
2023-10-10 10:58:33 +00:00
|
|
|
|
{
|
2024-09-16 12:13:12 +01:00
|
|
|
|
// Assault and has "(" character in name = simulated p scav
|
|
|
|
|
var nicknameContainsPScvCharacter = botOwner.Profile.Info.Nickname?.Contains("(");
|
|
|
|
|
return nicknameContainsPScvCharacter.HasValue && nicknameContainsPScvCharacter.Value && role == WildSpawnType.assault;
|
2023-10-10 10:58:33 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|