import { InsuranceController } from "https://deno.land/x/sptaki@1.2.0/controllers/mod.ts";
Constructors
Properties
Methods
Count all items in all insurance packages.
Get all insured items that are ready to be processed in a specific profile.
Finds the items that should be deleted based on the given Insurance object.
Get count of items to remove from weapon (take into account trader + price of attachment)
Initialize a Map object that holds main-parents to all of their attachments. Note that "main-parent" in this context refers to the parent item that an attachment is attached to. For example, a suppressor attached to a gun, not the backpack that the gun is located in (the gun's parent).
Takes an array of attachment items that belong to the same main-parent item, sorts them in descending order by their maximum price. For each attachment, a roll is made to determine if a deletion should be made. Once the number of deletions has been counted, the attachments are added to the toDelete Set, starting with the most valuable attachments first.
Process parent items and their attachments, updating the toDelete Set accordingly.
This method orchestrates the processing of insured items in a profile.
Process "regular" insurance items. Any insured item that is not an attached, attachment is considered a "regular" item. This method iterates over them, preforming item deletion rolls to see if they should be deleted. If so, they (and their attached, attachments, if any) are marked for deletion in the toDelete Set.
Remove an insurance package from a profile using the package's system data information.
Remove items from the insured items that should not be returned to the player.
Remove attachments that can not be moddable in-raid from the parentAttachmentsMap. If no moddable attachments remain, the parent is removed from the map as well.
Determines whether an insured item should be removed from the player's inventory based on a random roll and trader-specific return chance.
Handle sending the insurance message to the user that potentially contains the valid insurance items.
Handle client/insurance/items/list/cost Calculate insurance cost
Handle Insure event Add insurance to an item
Process insurance items of all profiles prior to being given back to the player through the mail service.
Process insurance items of a single profile prior to being given back to the player through the mail service.