Skip to main content
The Deno 2 Release Candidate is here
Learn more
class BotEquipmentFilterService
import { BotEquipmentFilterService } from "https://deno.land/x/sptaki@1.2.0/services/mod.ts";

Constructors

new
BotEquipmentFilterService(
logger: ILogger,
botHelper: BotHelper,
profileHelper: ProfileHelper,
configServer: ConfigServer,
)

Properties

protected
botConfig: IBotConfig
protected
botEquipmentConfig: Record<string, EquipmentFilters>
protected
botHelper: BotHelper
protected
configServer: ConfigServer
protected
logger: ILogger
protected
profileHelper: ProfileHelper

Methods

protected
adjustChances(equipmentChanges: Record<string, number>, baseValues: EquipmentChances | ModsChances): void

Iterate over the changes passed in and apply them to baseValues parameter

protected
adjustGenerationChances(generationChanges: Record<string, GenerationData>, baseBotGeneration: Generation): void

Iterate over the Generation changes and alter data in baseValues.Generation

protected
adjustWeighting(
weightingAdjustments: IAdjustmentDetails,
botItemPool: Record<string, any>,
showEditWarnings?: boolean,
): void

Add/Edit weighting changes to bot items using values from config/bot.json/equipment

protected
filterCartridges(
baseBotNode: IBotType,
): void

Filter bot cartridges based on blacklist and whitelist from config/bot.json Prioritizes whitelist first, if one is found blacklist is ignored

protected
filterEquipment(
baseBotNode: IBotType,
): void

Filter bot equipment based on blacklist and whitelist from config/bot.json Prioritizes whitelist first, if one is found blacklist is ignored

protected
getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails

Get the whitelist for a specific bot type that's within the players level

protected
getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails

Retrieve item weighting adjustments from bot.json config based on bot level

protected
getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails

Retrieve item weighting adjustments from bot.json config based on player level

filterBotEquipment(
sessionId: string,
baseBotNode: IBotType,
botLevel: number,
botGenerationDetails: BotGenerationDetails,
): void

Filter a bots data to exclude equipment and cartridges defines in the botConfig

getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails

Get an object that contains equipment and cartridge blacklists for a specified bot type

getBotEquipmentSettings(botEquipmentRole: string): EquipmentFilters

Get equipment settings for bot

getBotWeaponSightWhitelist(botEquipmentRole: string): Record<string, string[]>

Get weapon sight whitelist for a specific bot type