Skip to content

Commit 611e303

Browse files
authored
Add setCounts to LoadoutParameters (#279)
1 parent 407b67a commit 611e303

9 files changed

Lines changed: 154 additions & 234 deletions

File tree

api/shapes/loadouts.ts

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ export const enum LoadoutSort {
9494
ByName,
9595
}
9696

97+
/**
98+
* A mapping from a DestinyEquipableItemSetDefinition hash to the number of
99+
* pieces we require that provide that setBonus. The intention is that the count
100+
* is always exactly enough to activate some number of perks in that set (so
101+
* far, 2 or 4 pieces).
102+
*/
103+
export interface SetBonusCounts {
104+
[setBonusHash: number]: number | undefined;
105+
}
106+
97107
/**
98108
* Parameters that explain how this loadout was chosen (in Loadout Optimizer)
99109
* and at the same time, how this loadout should be configured when equipped.
@@ -123,29 +133,35 @@ export interface LoadoutParameters {
123133
* These are not associated with any specific item in the loadout - when
124134
* applying the loadout we should automatically determine the minimum of
125135
* changes required to match the desired mods, and apply these mods to the
126-
* equipped items.
136+
* equipped items. For shaders/ornaments, use modsByBucket instead.
127137
*/
128138
mods?: number[];
129139

130140
/**
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.
141+
* A list of armor perks that should be included in this loadout. This
142+
* expresses a desire in the Loadout Optimizer to generate sets that have
143+
* these perks.
133144
*
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.
145+
* For regular perks each occurrence of the perk in this list represents one
146+
* instance of the perk that should appear on an item in the loadout. For
147+
* armor set bonuses, use setBonuses instead.
138148
*
139149
* For example, this can be used to:
140150
* - Specify what exotic class item perks you want
141-
* - Specify set bonuses that you want to activate
142151
* - Specify that you want some seasonal armor perks to be used (e.g. 3
143-
* instances of the Iron Banner experience perk)
152+
* instances of Iron Lord's Pride)
144153
*
145154
* For picking specific perks on weapons, use modsByBucket instead.
146155
*/
147156
perks?: number[];
148157

158+
/**
159+
* The set bonuses that we want to activate with this loadout. This is a
160+
* mapping of one or more DestinyEquipableItemSetDefinition hashes to the
161+
* number of pieces we require that provide that setBonus.
162+
*/
163+
setBonuses?: SetBonusCounts;
164+
149165
/**
150166
* If set, after applying the mods above, all other mods will be removed from armor.
151167
*/
@@ -158,11 +174,11 @@ export interface LoadoutParameters {
158174
clearArmor?: boolean;
159175

160176
/**
161-
* Mods that must be applied to a specific bucket hash. In general, prefer to
162-
* use the flat mods list above, and rely on the loadout function to assign
163-
* mods automatically. However there are some mods like shaders which can't
164-
* be automatically assigned to the right piece. These only apply to the equipped
165-
* item.
177+
* Mods or perks that must be applied to a specific bucket hash. In general,
178+
* prefer to use the flat mods list above, and rely on the loadout function to
179+
* assign mods automatically. However there are some mods like shaders which
180+
* can't be automatically assigned to the right piece. These only apply to the
181+
* equipped item.
166182
*/
167183
modsByBucket?: {
168184
[bucketHash: number]: number[];

api/stately/generated/stately_item_types.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import type {
3030
ModsByBucketEntrySchema,
3131
Search,
3232
SearchSchema,
33+
SetBonusCountSchema,
3334
Settings,
3435
SettingsSchema,
3536
SocketOverrideSchema,
@@ -58,6 +59,7 @@ export declare const itemTypeToSchema: {
5859
LoadoutItem: typeof LoadoutItemSchema;
5960
LoadoutParameters: typeof LoadoutParametersSchema;
6061
ModsByBucketEntry: typeof ModsByBucketEntrySchema;
62+
SetBonusCount: typeof SetBonusCountSchema;
6163
SocketOverride: typeof SocketOverrideSchema;
6264
StatConstraint: typeof StatConstraintSchema;
6365
StatConstraintsEntry: typeof StatConstraintsEntrySchema;

api/stately/generated/stately_item_types.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
LoadoutShareSchema,
2020
ModsByBucketEntrySchema,
2121
SearchSchema,
22+
SetBonusCountSchema,
2223
SettingsSchema,
2324
SocketOverrideSchema,
2425
StatConstraintSchema,
@@ -48,13 +49,14 @@ export const typeToSchema = {
4849
LoadoutItem: LoadoutItemSchema,
4950
LoadoutParameters: LoadoutParametersSchema,
5051
ModsByBucketEntry: ModsByBucketEntrySchema,
52+
SetBonusCount: SetBonusCountSchema,
5153
SocketOverride: SocketOverrideSchema,
5254
StatConstraint: StatConstraintSchema,
5355
StatConstraintsEntry: StatConstraintsEntrySchema,
5456
};
5557

5658
/** The version of the schema that this client was generated for. */
57-
const SCHEMA_VERSION_ID = 6;
59+
const SCHEMA_VERSION_ID = 7;
5860
const SCHEMA_ID = 8030842688320564;
5961

6062
export function createClient(storeId, opts) {

0 commit comments

Comments
 (0)