mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
Co-authored-by: Dev <dev@dev.sp-tarkov.com> Co-authored-by: CWX <CWX@noreply.dev.sp-tarkov.com> Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com> Co-authored-by: RaiRaiTheRaichu <rairaitheraichu@noreply.dev.sp-tarkov.com> Co-authored-by: CWX <cwx@noreply.dev.sp-tarkov.com> Co-authored-by: Kaeno <e> Reviewed-on: SPT-AKI/Modules#33
48 lines
1.7 KiB
C#
48 lines
1.7 KiB
C#
using Aki.PrePatch;
|
|
using EFT;
|
|
|
|
namespace Aki.Custom.CustomAI
|
|
{
|
|
public static class AiHelpers
|
|
{
|
|
/// <summary>
|
|
/// Bot is a PMC when it has IsStreamerModeAvailable flagged and has a wildspawn type of 'sptBear' or 'sptUsec'
|
|
/// </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;
|
|
}
|
|
|
|
return (int)botRoleToCheck == AkiBotsPrePatcher.sptBearValue || (int)botRoleToCheck == AkiBotsPrePatcher.sptUsecValue;
|
|
}
|
|
|
|
public static bool BotIsPlayerScav(WildSpawnType role, BotOwner ___botOwner_0)
|
|
{
|
|
if (___botOwner_0.Profile.Info.Nickname.Contains("(") && role == WildSpawnType.assault)
|
|
{
|
|
// 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;
|
|
}
|
|
}
|
|
}
|