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

Store a mapping between weapons, their slots and the items that fit those slots

Constructors

new
BotEquipmentModPoolService(
logger: ILogger,
vfs: VFS,
itemHelper: ItemHelper,
databaseServer: DatabaseServer,
localisationService: LocalisationService,
configServer: ConfigServer,
)

Properties

protected
armorPoolGenerated: boolean
protected
botConfig: IBotConfig
protected
configServer: ConfigServer
protected
databaseServer: DatabaseServer
protected
gearModPool: Mods
protected
itemHelper: ItemHelper
protected
localisationService: LocalisationService
protected
logger: ILogger
protected
vfs: VFS
protected
weaponModPool: Mods
protected
weaponPoolGenerated: boolean

Methods

protected
generateGearPool(): void

Create gear mod pool and set generated flag to true

protected
generatePool(items: ITemplateItem[], poolType: string): void

Store dictionary of mods for each item passed in

protected
generateWeaponPool(): void

Create weapon mod pool and set generated flag to true

getCompatibleModsFoGearSlot(itemTpl: string, slotName: string): string[]

Get array of compatible mods for an items mod slot (generate pool if it doesnt exist already)

getCompatibleModsForWeaponSlot(itemTpl: string, slotName: string): string[]

Get array of compatible mods for an items mod slot (generate pool if it doesnt exist already)

getModsForGearSlot(itemTpl: string): Record<string, string[]>

Get mods for a piece of gear by its tpl

getModsForWeaponSlot(itemTpl: string): Record<string, string[]>

Get mods for a weapon by its tpl

resetPool(): void

Empty the mod pool