Skip to content

Commit

Permalink
chore: update types for spt 3.10.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Trap committed Dec 25, 2024
1 parent 1c2e61a commit 1a205b2
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 25 deletions.
12 changes: 10 additions & 2 deletions types/generators/BotGenerator.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
import { MinMax } from "@spt/models/common/MinMax";
import { IPmcData } from "@spt/models/eft/common/IPmcData";
import { IBaseJsonSkills, IBaseSkill, IBotBase, IInfo, IHealth as PmcHealth, ISkills as botSkills } from "@spt/models/eft/common/tables/IBotBase";
import { IAppearance, IBodyPart, IBotType, IHealth, IInventory } from "@spt/models/eft/common/tables/IBotType";
import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails";
Expand Down Expand Up @@ -47,9 +48,10 @@ export declare class BotGenerator {
* @param role e.g. assault / pmcbot
* @param difficulty easy/normal/hard/impossible
* @param botTemplate base bot template to use (e.g. assault/pmcbot)
* @returns
* profile PMC profile of player generating pscav
* @returns IBotBase
*/
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType, profile: IPmcData): IBotBase;
/**
* Create 1 bot of the type/side/difficulty defined in botGenerationDetails
* @param sessionId Session id
Expand Down Expand Up @@ -79,6 +81,12 @@ export declare class BotGenerator {
* @returns IBotBase object
*/
protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: IBotGenerationDetails): IBotBase;
/**
* Should this bot have a name like "name (Pmc Name)" and be alterd by client patch to be hostile to player
* @param botRole Role bot has
* @returns True if name should be simulated pscav
*/
protected shouldSimulatePlayerScav(botRole: string): boolean;
/**
* Get exp for kill by bot difficulty
* @param experience Dict of difficulties and experience
Expand Down
12 changes: 12 additions & 0 deletions types/helpers/RagfairOfferHelper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ export declare class RagfairOfferHelper {
* @returns IRagfairOffer array
*/
getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, pmcData: IPmcData): IRagfairOffer[];
/**
* Get offers that have not exceeded buy limits
* @param possibleOffers offers to process
* @returns Offers
*/
protected getOffersInsideBuyRestrictionLimits(possibleOffers: IRagfairOffer[]): IRagfairOffer[];
/**
* Check if offer is from trader standing the player does not have
* @param offer Offer to check
Expand Down Expand Up @@ -209,4 +215,10 @@ export declare class RagfairOfferHelper {
* @returns True if in range
*/
protected itemQualityInRange(item: IItem, min: number, max: number): boolean;
/**
* Does this offer come from a trader
* @param offer Offer to check
* @returns True = from trader
*/
offerIsFromTrader(offer: IRagfairOffer): boolean;
}
1 change: 1 addition & 0 deletions types/models/eft/common/tables/IBotBase.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export interface IUnlockedInfo {
export interface IInfo {
EntryPoint: string;
Nickname: string;
MainProfileNickname?: string;
LowerNickname: string;
Side: string;
SquadInviteRestriction: boolean;
Expand Down
2 changes: 2 additions & 0 deletions types/models/spt/config/IInventoryConfig.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export interface IInventoryConfig extends IBaseConfig {
customMoneyTpls: string[];
/** Multipliers for skill gain when inside menus, NOT in-game */
skillGainMultiplers: Record<string, number>;
/** Container Tpls that shoud be deprioritised when choosing where to take money from for payments */
deprioritisedMoneyContainers: string[];
}
export interface IRewardDetails {
rewardCount: number;
Expand Down
2 changes: 2 additions & 0 deletions types/models/spt/config/IPmcConfig.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ export interface IPmcTypes {
bear: string;
}
export interface ISlotLootSettings {
/** Item Type whitelist */
whitelist: string[];
/** item tpl blacklist */
blacklist: string[];
}
export interface IMinMaxLootValue extends MinMax {
Expand Down
2 changes: 2 additions & 0 deletions types/models/spt/config/IRagfairConfig.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export interface IDynamic {
blacklist: IRagfairBlacklist;
/** Dict of price limits keyed by item type */
unreasonableModPrices: Record<string, IUnreasonableModPrices>;
/** Custom rouble prices for items to override values from prices.json */
itemPriceOverrideRouble: Record<string, number>;
}
export interface IPriceRanges {
default: MinMax;
Expand Down
2 changes: 2 additions & 0 deletions types/models/spt/config/ISeasonalEventConfig.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export interface ISeasonalEventConfig extends IBaseConfig {
enableSeasonalEventDetection: boolean;
/** event / botType / equipSlot / itemid */
eventGear: Record<string, Record<string, Record<string, Record<string, number>>>>;
/** event / bot type / equipSlot / itemid */
eventLoot: Record<string, Record<string, Record<string, Record<string, number>>>>;
events: ISeasonalEvent[];
eventBotMapping: Record<string, string>;
eventBossSpawns: Record<string, Record<string, IBossLocationSpawn[]>>;
Expand Down
14 changes: 9 additions & 5 deletions types/services/BotNameService.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BotHelper } from "@spt/helpers/BotHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { IBotBase } from "@spt/models/eft/common/tables/IBotBase";
import { IBotType } from "@spt/models/eft/common/tables/IBotType";
import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails";
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
Expand Down Expand Up @@ -38,10 +39,13 @@ export declare class BotNameService {
*/
generateUniqueBotNickname(botJsonTemplate: IBotType, botGenerationDetails: IBotGenerationDetails, botRole: string, uniqueRoles?: string[]): string;
/**
* Should this bot have a name like "name (Pmc Name)"
* @param botRole Role bot has
* @returns True if name should be simulated pscav
* Add random PMC name to bots MainProfileNickname property
* @param bot Bot to update
*/
protected shouldSimulatePlayerScavName(botRole: string): boolean;
protected addPlayerScavNameSimulationSuffix(nickname: string): string;
addRandomPmcNameToBotMainProfileNicknameProperty(bot: IBotBase): void;
/**
* Choose a random PMC name from bear or usec bot jsons
* @returns PMC name as string
*/
protected getRandomPMCName(): string;
}
4 changes: 2 additions & 2 deletions types/services/DatabaseService.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export declare class DatabaseService {
*/
getCustomization(): Record<string, ICustomizationItem>;
/**
* @returns assets/database/templates/items.json
* @returns assets/database/templates/handbook.json
*/
getHandbook(): IHandbookBase;
/**
Expand All @@ -101,7 +101,7 @@ export declare class DatabaseService {
*/
getProfiles(): IProfileTemplates;
/**
* @returns assets/database/templates/items.json
* @returns assets/database/templates/quests.json
*/
getQuests(): Record<string, IQuest>;
/**
Expand Down
14 changes: 0 additions & 14 deletions types/services/InsuranceService.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ export declare class InsuranceService {
* @returns Timestamp to return items to player in seconds
*/
protected getInsuranceReturnTimestamp(pmcData: IPmcData, trader: ITraderBase): number;
/**
* Take the insurance item packages within a profile session and ensure that each of the items in that package are
* not orphaned from their parent ID.
*
* @param sessionID The session ID to update insurance equipment packages in.
* @returns void
*/
protected adoptOrphanedInsEquipment(sessionID: string): void;
protected getMaxInsuranceStorageTime(traderBase: ITraderBase): number;
/**
* Store lost gear post-raid inside profile, ready for later code to pick it up and mail it
Expand Down Expand Up @@ -127,10 +119,4 @@ export declare class InsuranceService {
* @returns price in roubles
*/
getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: IItem, traderId: string): number;
/**
* Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance.
* @param sessionID Players id
* @returns The root item Id.
*/
getRootItemParentID(sessionID: string): string;
}
6 changes: 5 additions & 1 deletion types/services/PaymentService.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { IItem } from "@spt/models/eft/common/tables/IItem";
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
import { IProcessBuyTradeRequestData } from "@spt/models/eft/trade/IProcessBuyTradeRequestData";
import { IProcessSellTradeRequestData } from "@spt/models/eft/trade/IProcessSellTradeRequestData";
import { IInventoryConfig } from "@spt/models/spt/config/IInventoryConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseService } from "@spt/services/DatabaseService";
import { LocalisationService } from "@spt/services/LocalisationService";
import { HashUtil } from "@spt/utils/HashUtil";
Expand All @@ -24,7 +26,9 @@ export declare class PaymentService {
protected inventoryHelper: InventoryHelper;
protected localisationService: LocalisationService;
protected paymentHelper: PaymentHelper;
constructor(logger: ILogger, hashUtil: HashUtil, httpResponse: HttpResponseUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, localisationService: LocalisationService, paymentHelper: PaymentHelper);
protected configServer: ConfigServer;
protected inventoryConfig: IInventoryConfig;
constructor(logger: ILogger, hashUtil: HashUtil, httpResponse: HttpResponseUtil, databaseService: DatabaseService, handbookHelper: HandbookHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, localisationService: LocalisationService, paymentHelper: PaymentHelper, configServer: ConfigServer);
/**
* Take money and insert items into return to server request
* @param pmcData Pmc profile
Expand Down
2 changes: 2 additions & 0 deletions types/services/PostDbLoadService.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,6 @@ export declare class PostDbLoadService {
*/
protected validateQuestAssortUnlocksExist(): void;
protected setAllDbItemsAsSellableOnFlea(): void;
protected addMissingTraderBuyRestrictionMaxValue(): void;
protected applyFleaPriceOverrides(): void;
}
6 changes: 6 additions & 0 deletions types/services/ProfileFixerService.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ export declare class ProfileFixerService {
* @param pmcProfile profile to check and fix
*/
checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void;
/**
* Resolve any dialogue attachments that were accidentally created using the player's equipment ID as
* the stash root object ID
* @param fullProfile
*/
checkForAndFixDialogueAttachments(fullProfile: ISptProfile): void;
/**
* Find issues in the scav profile data that may cause issues
* @param scavProfile profile to check and fix
Expand Down
13 changes: 12 additions & 1 deletion types/services/SeasonalEventService.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ export declare class SeasonalEventService {
* @returns bots with equipment changes
*/
protected getEventBotGear(eventType: SeasonalEventType): Record<string, Record<string, Record<string, number>>>;
/**
* Get a dictionary of loot changes to apply to bots for a specific event e.g. Christmas/Halloween
* @param eventName Name of event to get gear changes for
* @returns bots with loot changes
*/
protected getEventBotLoot(eventType: SeasonalEventType): Record<string, Record<string, Record<string, number>>>;
/**
* Get the dates each seasonal event starts and ends at
* @returns Record with event name + start/end date
Expand All @@ -108,7 +114,7 @@ export declare class SeasonalEventService {
/**
* Store active events inside class array property `currentlyActiveEvents` + set class properties: christmasEventActive/halloweenEventActive
*/
protected cacheActiveEvents(): void;
cacheActiveEvents(): void;
/**
* Get the currently active weather season e.g. SUMMER/AUTUMN/WINTER
* @returns Season enum value
Expand Down Expand Up @@ -171,6 +177,11 @@ export declare class SeasonalEventService {
* @param eventName Name of the event to read equipment in from config
*/
protected addEventGearToBots(eventType: SeasonalEventType): void;
/**
* Read in data from seasonalEvents.json and add found loot items to bots
* @param eventName Name of the event to read loot in from config
*/
protected addEventLootToBots(eventType: SeasonalEventType): void;
/**
* Add pumpkin loot boxes to scavs
*/
Expand Down
13 changes: 13 additions & 0 deletions types/utils/ProgressWriter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export declare class ProgressWriter {
private count;
private total?;
private done;
private barFillChar;
private barEmptyChar;
private maxBarLength;
constructor(total: number, maxBarLength?: number, barFillChar?: string, barEmptyChar?: string);
/**
* Increment the progress counter and update the progress bar display.
*/
increment(): void;
}

0 comments on commit 1a205b2

Please sign in to comment.