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

Constructors

new
BotWeaponModLimitService(
logger: ILogger,
configServer: ConfigServer,
itemHelper: ItemHelper,
)

Properties

protected
botConfig: IBotConfig
protected
configServer: ConfigServer
protected
itemHelper: ItemHelper
protected
logger: ILogger

Methods

protected
weaponModLimitReached(
modTpl: string,
currentCount: { count: number; },
maxLimit: number,
botRole: string,
): boolean

Check if the specific item type on the weapon has reached the set limit

Initalise mod limits to be used when generating a weapon

weaponModHasReachedLimit(
botRole: string,
modTemplate: ITemplateItem,
modLimits: BotModLimits,
modsParent: ITemplateItem,
weapon: Item[],
): boolean

Check if weapon mod item is on limited list + has surpassed the limit set for it Exception: Always allow ncstar backup mount Exception: Always allow scopes with a scope for a parent Exception: Always disallow mounts that hold only scopes once scope limit reached Exception: Always disallow mounts that hold only flashlights once flashlight limit reached