2024-07-04 14:11:11 +00:00
|
|
|
|
using EFT;
|
2024-08-15 08:45:47 +00:00
|
|
|
|
using System.Collections.Generic;
|
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)
|
|
|
|
|
{
|
|
|
|
|
// PMCs can sometimes have thier role changed to 'assaultGroup' by the client, we need a alternate way to figure out if they're a spt pmc
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-06 16:59:53 +00:00
|
|
|
|
return botRoleToCheck == WildSpawnType.pmcBEAR || botRoleToCheck == 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-02-11 10:33:59 +00:00
|
|
|
|
if (role == WildSpawnType.assault && nickname.Contains("("))
|
2023-10-10 10:58:33 +00:00
|
|
|
|
{
|
|
|
|
|
// Check bot is pscav by looking for the opening parentheses of their nickname e.g. scavname (pmc name)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static bool BotIsNormalAssaultScav(WildSpawnType role, BotOwner ___botOwner_0)
|
|
|
|
|
{
|
|
|
|
|
// Is assault + no (
|
|
|
|
|
if (!___botOwner_0.Profile.Info.Nickname.Contains("(") && role == WildSpawnType.assault)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-08-15 08:45:47 +00:00
|
|
|
|
|
|
|
|
|
public static List<BotOwner> GetAllMembers(this BotsGroup group)
|
|
|
|
|
{
|
|
|
|
|
List<BotOwner> members = new List<BotOwner>();
|
|
|
|
|
|
|
|
|
|
if (group != null)
|
|
|
|
|
{
|
|
|
|
|
for (int m = 0; m < group.MembersCount; m++)
|
|
|
|
|
{
|
|
|
|
|
members.Add(group.Member(m));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return members;
|
|
|
|
|
}
|
2023-10-10 10:58:33 +00:00
|
|
|
|
}
|
|
|
|
|
}
|