import { FenceService } from "https://deno.land/x/sptaki@1.2.0/services/mod.ts";
Handle actions surrounding Fence e.g. generating or refreshing assorts / get next refresh time
Constructors
Properties
Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts()
Main assorts you see at all rep levels
Assorts shown on a separate tab when you max out fence rep
Methods
Add item assorts to existing assort data
Find presets in base fence assort and add desired number to 'assorts' parameter
Adjust all items contained inside an assort by a multiplier
Adjust assorts price by a modifier
Adjust price of item based on what is left to buy (resource/uses left)
Convert the intermediary assort data generated into format client can process
Hydrate assorts parameter object with generated assorts
Create skeleton to hold assort items
Create object that contains calculated fence assort item values to make based on config Stored in this.desiredAssortCounts
Delete desired number of items from assort (including children)
Calculate the overall price for an ammo box, where only one item is the ammo box itself and every other items are the bullets in that box
Get an integer rounded count of items to replace based on percentrage from traderConfig value
Get fence refresh time in seconds
Get values that will hydrate the passed in assorts back to the desired counts
Find an assort item that matches the first parameter, also matches based on upd properties e.g. salewa hp resource units left
Generate a randomised current and max durabiltiy value for an armor item
Get stack size of a singular item (no mods)
Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config
Construct item limit record to hold max and current item count
Should this item be forced into only 1 stack on fence
Merge two trader assort files together
Roll % chance check to see if item should be removed
Adjust plate / soft insert durability values
Randomise items' upd properties e.g. med packs/weapons/armor
Choose an item at random and remove it + mods from assorts
Remove parts of a weapon prior to being listed on flea
Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead
Adds to fence assort a single item (with its children)
Remove or lower stack size of an assort from fence by id
Create trader assorts for fence and store in fenceService cache Uses fence base cache generatedon server start as a base
Get discount fence assort
Get assorts player can purchase Adjust prices based on fence level of player
Get fence level the passed in profile has
Calculates the overall price for an item (with all its children)
Get main fence assort
Get the next update timestamp for fence
Get the count of items fence offers
Get fence assorts with no price adjustments based on fence rep
Does fence need to perform a partial refresh because its passed the refresh timer defined in trader.json
Replace a percentage of fence assorts with freshly generated items
Replace discount fence assort with new assort
Replace main fence assort with new assort
Replace high rep level fence assort with new assort