@xforge-dev/forge-kit 0.24.2 → 0.24.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -133,7 +133,8 @@ the lowercased name without spaces, so a stored board never holds names.
133
133
 
134
134
  v.272 removes the board. The points model sits beside it (the board stays for app versions still reading it):
135
135
  `legionPoints` (the automatic raid's ranks, B 1 … SSS 5, as many members as the Legion rank holds; `raidSplit` gives
136
- those and the bonus-only rest, since every member at rank B or higher gives its effect: `effectMembers`), stat levels
136
+ those and the bonus-only rest, since every member at rank B or higher gives its effect: `effectMembers`; pass the
137
+ owned event blocks and the two equipped ones add a member's points of their rank each: `legionPointsBreakdown`), stat levels
137
138
  (`LegionStats`, one point a level, what a grid square was: same values, caps 15 inner and 40 outer),
138
139
  `allocationProblem`, `statTotals`, `suggestStats`, the two highest event blocks (`appliedEventBlocks`), 10 named
139
140
  presets (`SharedPoints`, stored under `points` in the shared row so an older board write leaves it alone) and the 5th
package/dist/legion.d.ts CHANGED
@@ -223,8 +223,19 @@ export declare function raidSplit<M extends PointsMember>(members: readonly M[],
223
223
  export declare const effectMembers: <M extends PointsMember>(members: readonly M[]) => M[];
224
224
  /** The two event blocks that apply: the highest values among those owned. */
225
225
  export declare function appliedEventBlocks(owned: readonly EventBlock[]): EventBlock[];
226
- /** Legion Points to spend: the ranks of the members the raid counts. Event blocks add ATT, not points. */
227
- export declare function legionPoints(members: readonly PointsMember[], legionLevel: number): number;
226
+ /** Legion Points an equipped event block gives: a member's of its rank (B 1 … SSS 5; Ride or Die is SSS, as on the board). */
227
+ export declare const eventBlockPoints: (b: EventBlock) => number;
228
+ /** Legion Points split: the members the raid counts, and the two equipped event blocks (the two highest owned). */
229
+ export declare function legionPointsBreakdown(members: readonly PointsMember[], legionLevel: number, blocks?: readonly EventBlock[]): {
230
+ members: number;
231
+ blocks: number;
232
+ total: number;
233
+ };
234
+ /**
235
+ * Legion Points to spend: the ranks of the members the raid counts, plus the two equipped event blocks' (a member's of
236
+ * the same rank each; they don't take a member's place). Their ATT is separate.
237
+ */
238
+ export declare function legionPoints(members: readonly PointsMember[], legionLevel: number, blocks?: readonly EventBlock[]): number;
228
239
  /** Points the stat levels spend. */
229
240
  export declare const pointsSpent: (stats: LegionStats) => number;
230
241
  /** What each stat gives at its level (only stats with a level). */
package/dist/legion.js CHANGED
@@ -261,9 +261,20 @@ export const effectMembers = (members) => members.filter((m) => m.rank);
261
261
  export function appliedEventBlocks(owned) {
262
262
  return [...owned].sort((a, b) => b.value - a.value).slice(0, MAX_EVENT_BLOCKS);
263
263
  }
264
- /** Legion Points to spend: the ranks of the members the raid counts. Event blocks add ATT, not points. */
265
- export function legionPoints(members, legionLevel) {
266
- return raidComposition(members, legionLevel).reduce((t, m) => t + RANK_POINTS[m.rank], 0);
264
+ /** Legion Points an equipped event block gives: a member's of its rank (B 1 … SSS 5; Ride or Die is SSS, as on the board). */
265
+ export const eventBlockPoints = (b) => eventBlockSquares(b);
266
+ /** Legion Points split: the members the raid counts, and the two equipped event blocks (the two highest owned). */
267
+ export function legionPointsBreakdown(members, legionLevel, blocks = []) {
268
+ const m = raidComposition(members, legionLevel).reduce((t, x) => t + RANK_POINTS[x.rank], 0);
269
+ const b = appliedEventBlocks(blocks).reduce((t, x) => t + eventBlockPoints(x), 0);
270
+ return { members: m, blocks: b, total: m + b };
271
+ }
272
+ /**
273
+ * Legion Points to spend: the ranks of the members the raid counts, plus the two equipped event blocks' (a member's of
274
+ * the same rank each; they don't take a member's place). Their ATT is separate.
275
+ */
276
+ export function legionPoints(members, legionLevel, blocks = []) {
277
+ return legionPointsBreakdown(members, legionLevel, blocks).total;
267
278
  }
268
279
  /** Points the stat levels spend. */
269
280
  export const pointsSpent = (stats) => Object.values(stats).reduce((t, n) => t + (n ?? 0), 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xforge-dev/forge-kit",
3
- "version": "0.24.2",
3
+ "version": "0.24.3",
4
4
  "description": "Shared auth, app registry and UI for xForge apps",
5
5
  "license": "MIT",
6
6
  "repository": {