Skip to content

Commit be19455

Browse files
authored
Add new loadout parameters and settings (#277)
* Add minstat/maxstat to stat constraints * Add armor perks constraints * Add new fields to stately model * Add a new setting * Add validation * Fix * Upgrade * Oof
1 parent 1320fc8 commit be19455

16 files changed

Lines changed: 411 additions & 264 deletions

api/shapes/loadouts.ts

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,25 @@ export interface LoadoutParameters {
127127
*/
128128
mods?: number[];
129129

130+
/**
131+
* A list of perks that should be activated by this loadout. This expresses a
132+
* desire in the Loadout Optimizer to generate sets that have these perks.
133+
*
134+
* For "armor set perks" this indicates that the perk should be activated by
135+
* having enough set pieces to activate it. For regular perks, each occurrence
136+
* of the perk in this list represents one instance of the perk that should
137+
* appear on an item in the loadout.
138+
*
139+
* For example, this can be used to:
140+
* - Specify what exotic class item perks you want
141+
* - Specify set bonuses that you want to activate
142+
* - Specify that you want some seasonal armor perks to be used (e.g. 3
143+
* instances of the Iron Banner experience perk)
144+
*
145+
* For picking specific perks on weapons, use modsByBucket instead.
146+
*/
147+
perks?: number[];
148+
130149
/**
131150
* If set, after applying the mods above, all other mods will be removed from armor.
132151
*/
@@ -206,6 +225,7 @@ export const defaultLoadoutParameters: LoadoutParameters = {
206225
{ statHash: 4244567218 }, // Strength
207226
],
208227
mods: [],
228+
perks: [],
209229
assumeArmorMasterwork: AssumeArmorMasterwork.None,
210230
autoStatMods: true,
211231
includeRuntimeStatBenefits: true,
@@ -218,8 +238,24 @@ export const defaultLoadoutParameters: LoadoutParameters = {
218238
export interface StatConstraint {
219239
/** The stat definition hash of the stat */
220240
statHash: number;
221-
/** The minimum tier value for the stat. 0 if unset. */
241+
/**
242+
* The minimum tier value for the stat. 0 if unset.
243+
* @deprecated in favor of minStat
244+
*/
222245
minTier?: number;
223-
/** The maximum tier value for the stat. 10 if unset. */
246+
/**
247+
* The maximum tier value for the stat. 10 if unset.
248+
* @deprecated in favor of maxStat
249+
*/
224250
maxTier?: number;
251+
/**
252+
* Minimum absolute value for the stat. 0 if unset. Replaces minTier in Edge
253+
* of Fate.
254+
*/
255+
minStat?: number;
256+
/**
257+
* Maximum absolute value for the stat. Max Possible Stat Value if unset.
258+
* Replaces maxTier in Edge of Fate.
259+
*/
260+
maxStat?: number;
225261
}

api/shapes/settings.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ export interface Settings {
158158
/** How grouped weapons in the vault should be displayed. */
159159
vaultWeaponGroupingStyle: VaultWeaponGroupingStyle;
160160

161+
/** How grouped armor in the vault should be displayed. */
162+
vaultArmorGroupingStyle: VaultWeaponGroupingStyle;
163+
161164
/** The currently selected item popup tab. */
162165
itemPopupTab: ItemPopupTab;
163166
}
@@ -250,5 +253,6 @@ export const defaultSettings: Settings = {
250253
vendorsHideSilverItems: false,
251254
vaultWeaponGrouping: '',
252255
vaultWeaponGroupingStyle: VaultWeaponGroupingStyle.Lines,
256+
vaultArmorGroupingStyle: VaultWeaponGroupingStyle.Inline,
253257
itemPopupTab: ItemPopupTab.Overview,
254258
};

api/stately/generated/stately_item_types.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import type {
1212
ArtifactUnlocksSchema,
1313
CollapsedSectionSchema,
1414
CustomStatDefSchema,
15-
CustomStatWeightsEntrySchema,
1615
CustomStatsEntrySchema,
16+
CustomStatWeightsEntrySchema,
1717
GlobalSettings,
1818
GlobalSettingsSchema,
1919
InGameLoadoutIdentifiersSchema,
@@ -52,8 +52,8 @@ export declare const itemTypeToSchema: {
5252
ArtifactUnlocks: typeof ArtifactUnlocksSchema;
5353
CollapsedSection: typeof CollapsedSectionSchema;
5454
CustomStatDef: typeof CustomStatDefSchema;
55-
CustomStatWeightsEntry: typeof CustomStatWeightsEntrySchema;
5655
CustomStatsEntry: typeof CustomStatsEntrySchema;
56+
CustomStatWeightsEntry: typeof CustomStatWeightsEntrySchema;
5757
InGameLoadoutIdentifiers: typeof InGameLoadoutIdentifiersSchema;
5858
LoadoutItem: typeof LoadoutItemSchema;
5959
LoadoutParameters: typeof LoadoutParametersSchema;

api/stately/generated/stately_item_types.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export const typeToSchema = {
4242
ArtifactUnlocks: ArtifactUnlocksSchema,
4343
CollapsedSection: CollapsedSectionSchema,
4444
CustomStatDef: CustomStatDefSchema,
45-
CustomStatWeightsEntry: CustomStatWeightsEntrySchema,
4645
CustomStatsEntry: CustomStatsEntrySchema,
46+
CustomStatWeightsEntry: CustomStatWeightsEntrySchema,
4747
InGameLoadoutIdentifiers: InGameLoadoutIdentifiersSchema,
4848
LoadoutItem: LoadoutItemSchema,
4949
LoadoutParameters: LoadoutParametersSchema,
@@ -54,13 +54,14 @@ export const typeToSchema = {
5454
};
5555

5656
/** The version of the schema that this client was generated for. */
57-
const SCHEMA_VERSION_ID = 3;
57+
const SCHEMA_VERSION_ID = 6;
58+
const SCHEMA_ID = 8030842688320564;
5859

5960
export function createClient(storeId, opts) {
60-
return createGenericClient(storeId, typeToSchema, SCHEMA_VERSION_ID, opts);
61+
return createGenericClient(storeId, typeToSchema, SCHEMA_VERSION_ID, SCHEMA_ID, opts);
6162
}
6263

63-
if (createGenericClient.length < 3) {
64+
if (createGenericClient.length < 4) {
6465
throw new Error(
6566
'Your version of @stately-cloud/client is too old. Please update to the latest version.',
6667
);

0 commit comments

Comments
 (0)