@elite-dangerous-almanac/core 0.1.4 → 0.1.5
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/PROVENANCE/ships/SOURCES.md +50 -7
- package/THIRD_PARTY_NOTICES.md +4 -3
- package/dist/{chunk-MGT52MJM.js → chunk-77QR33ON.js} +1 -1
- package/dist/{chunk-SVZARHWP.js → chunk-DYPOL3CI.js} +1 -1
- package/dist/{chunk-SVZARHWP.js.map → chunk-DYPOL3CI.js.map} +1 -1
- package/dist/{chunk-EU42PAV4.js → chunk-MTAGULIO.js} +1 -1
- package/dist/{chunk-EU42PAV4.js.map → chunk-MTAGULIO.js.map} +1 -1
- package/dist/{chunk-7XXNVKAB.js → chunk-XULHGGG4.js} +1 -1
- package/dist/{chunk-7XXNVKAB.js.map → chunk-XULHGGG4.js.map} +1 -1
- package/dist/equipment/index.js +1 -1
- package/dist/equipment/upgrade-costs.js +1 -1
- package/dist/equipment/upgrade-costs.js.map +1 -1
- package/dist/ships/blueprint-costs.d.ts +110 -21
- package/dist/ships/blueprint-costs.js +1 -1
- package/dist/ships/blueprint-costs.js.map +1 -1
- package/dist/ships/engineering.d.ts +5 -4
- package/dist/ships/engineering.js +1 -1
- package/dist/ships/experimental-effect-costs.d.ts +5 -0
- package/dist/ships/experimental-effect-costs.js.map +1 -1
- package/dist/ships/index.d.ts +3 -1
- package/dist/ships/index.js +1 -1
- package/dist/ships/pre-engineered-stats.js +1 -1
- package/dist/ships/pre-engineered.d.ts +9 -3
- package/dist/ships/pre-engineered.js +1 -1
- package/dist/ships/ship-loadout.d.ts +5 -0
- package/dist/ships/ship-loadout.js +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-MGT52MJM.js.map → chunk-77QR33ON.js.map} +0 -0
|
@@ -8,10 +8,12 @@ import './slots.js';
|
|
|
8
8
|
* The **blueprint cost catalogue** — material shopping lists kept separate from
|
|
9
9
|
* blueprint mechanics so calculating or editing a build does not bundle them.
|
|
10
10
|
*
|
|
11
|
-
* Each blueprint id maps its available grades to
|
|
11
|
+
* Each blueprint id maps its available grades to what one roll at that grade costs.
|
|
12
12
|
* Use {@link getBlueprintGradeCost} for that per-roll recipe or {@link getBlueprintCost}
|
|
13
|
-
* for the complete weighted climb to a target grade.
|
|
14
|
-
*
|
|
13
|
+
* for the complete weighted climb to a target grade. Both answer with a
|
|
14
|
+
* {@link BlueprintCost} — the materials consumed *and* the **Merc Coin** billed beside
|
|
15
|
+
* them, since 25 recipes charge a currency as well. The matching stat modifiers live in
|
|
16
|
+
* `ships/blueprints`.
|
|
15
17
|
*
|
|
16
18
|
* Data from EDCD/coriolis-data (`modifications/blueprints.json`), with Operations and
|
|
17
19
|
* Anti-Guardian recipes from the Inara registry and Frontier update notes; see
|
|
@@ -57,6 +59,11 @@ declare const BLUEPRINT_COSTS: Readonly<Record<string, BlueprintGradeCosts>>;
|
|
|
57
59
|
*
|
|
58
60
|
* @param fdname - The blueprint id, e.g. `"FSD_LongRange"`, matched
|
|
59
61
|
* case-insensitively after trimming surrounding whitespace.
|
|
62
|
+
* @remarks
|
|
63
|
+
* The material half only, straight from the catalogue. The Merc Coin some recipes charge
|
|
64
|
+
* beside it lives in {@link BLUEPRINT_MERC_COIN_COSTS}; use {@link getBlueprintGradeCost}
|
|
65
|
+
* or {@link getBlueprintCost} to get both halves of a cost together.
|
|
66
|
+
*
|
|
60
67
|
* @returns The frozen grade-to-material-list record, or `null` if no ordinary craft
|
|
61
68
|
* cost is catalogued (including a known fixed reward identity).
|
|
62
69
|
* @throws {TypeError} If `fdname` is present and not a string. A nullish
|
|
@@ -71,51 +78,94 @@ declare const BLUEPRINT_COSTS: Readonly<Record<string, BlueprintGradeCosts>>;
|
|
|
71
78
|
*/
|
|
72
79
|
declare function getBlueprintCosts(fdname: string): BlueprintGradeCosts | null;
|
|
73
80
|
/**
|
|
74
|
-
*
|
|
81
|
+
* What one engineering step costs — the materials it consumes and the Merc Coin billed
|
|
82
|
+
* beside them.
|
|
83
|
+
*
|
|
84
|
+
* @remarks
|
|
85
|
+
* Merc Coin has no credit equivalent and is not a material, so it is its own member
|
|
86
|
+
* rather than an entry in `materials`. Only 25 of the catalogued blueprints charge any;
|
|
87
|
+
* on every other recipe `mercCoins` is `0`, which is a real amount rather than a missing
|
|
88
|
+
* one — a step that is catalogued at all reports both halves of its cost.
|
|
89
|
+
*/
|
|
90
|
+
interface BlueprintCost {
|
|
91
|
+
/**
|
|
92
|
+
* Every material the step consumes. One entry per distinct material, each `count`
|
|
93
|
+
* already multiplied out for however many rolls the step covers.
|
|
94
|
+
*/
|
|
95
|
+
readonly materials: readonly EngineeringMaterial[];
|
|
96
|
+
/**
|
|
97
|
+
* The Merc Coin the step bills, already weighted for however many rolls the step
|
|
98
|
+
* covers, exactly as the `materials` counts are.
|
|
99
|
+
*
|
|
100
|
+
* `0` either where the recipe charges no currency — 25 blueprints do and the rest do
|
|
101
|
+
* not — or where this particular step covers no grade that charges. It is therefore
|
|
102
|
+
* an amount for *this* step, and reading `0` as "this blueprint never charges Merc
|
|
103
|
+
* Coin" is wrong on exactly the 25 that do.
|
|
104
|
+
*/
|
|
105
|
+
readonly mercCoins: number;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Look up what **one roll** at one blueprint grade costs.
|
|
75
109
|
*
|
|
76
110
|
* @param fdname - The blueprint id, e.g. `"FSD_LongRange"`, matched
|
|
77
111
|
* case-insensitively after trimming surrounding whitespace.
|
|
78
112
|
* @param grade - The grade, `1`–`5`.
|
|
79
|
-
* @returns The
|
|
80
|
-
* catalogued for the blueprint and grade.
|
|
113
|
+
* @returns The materials one roll consumes and the Merc Coin it bills, or `null` if no
|
|
114
|
+
* ordinary craft cost is catalogued for the blueprint and grade. `materials` is the
|
|
115
|
+
* frozen catalogue list; `mercCoins` is `0` unless the recipe charges a currency.
|
|
81
116
|
* @throws {RangeError} If `grade` is not an integer from 1 through 5.
|
|
117
|
+
* @throws {TypeError} If `fdname` is present and not a string. A nullish
|
|
118
|
+
* `fdname` is a miss, answered the way an unrecognised one is.
|
|
82
119
|
* @example
|
|
83
120
|
* ```ts
|
|
84
121
|
* import { getBlueprintGradeCost } from '@elite-dangerous-almanac/core/ships/blueprint-costs';
|
|
85
122
|
*
|
|
86
|
-
* getBlueprintGradeCost('FSD_LongRange', 5);
|
|
123
|
+
* getBlueprintGradeCost('FSD_LongRange', 5)?.materials;
|
|
87
124
|
* // -> [{ symbol: 'Arsenic', name: 'Arsenic', count: 1 }, ...]
|
|
125
|
+
* getBlueprintGradeCost('FSD_LongRange', 5)?.mercCoins; // -> 0
|
|
126
|
+
* getBlueprintGradeCost('RailGun_LongShot', 5)?.mercCoins; // -> 50
|
|
88
127
|
* ```
|
|
89
128
|
*/
|
|
90
|
-
declare function getBlueprintGradeCost(fdname: string, grade: number):
|
|
129
|
+
declare function getBlueprintGradeCost(fdname: string, grade: number): BlueprintCost | null;
|
|
91
130
|
/**
|
|
92
|
-
* Compute the **total**
|
|
131
|
+
* Compute the **total** cost of engineering a module up to a grade — every grade the
|
|
93
132
|
* module still has to climb, each rolled the number of times it takes to complete
|
|
94
|
-
* ({@link rollsForGrade}: grade `g` needs `g` rolls), summed into one shopping list
|
|
133
|
+
* ({@link rollsForGrade}: grade `g` needs `g` rolls), summed into one shopping list and
|
|
134
|
+
* one Merc Coin total.
|
|
95
135
|
*
|
|
96
136
|
* By default it prices the whole climb from unengineered; pass `currentGrade` to price
|
|
97
137
|
* only what remains. Each grade `g` in `currentGrade + 1 … grade` contributes
|
|
98
|
-
* `g ·` (grade `g`'s
|
|
138
|
+
* `g ·` (grade `g`'s cost). To price a single grade's complete progression, set
|
|
99
139
|
* `currentGrade` to `grade − 1`; use {@link getBlueprintGradeCost} for one roll.
|
|
100
140
|
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
141
|
+
* A Mercenary article is bought at grade 1 and its recipe defines grades 2–5, so pass
|
|
142
|
+
* `1` to price what an engineer can still add. The four ordinary-menu recipes that also
|
|
143
|
+
* bill Merc Coin — `FuelScoop_Efficiency` and the three `*Laser_ThermalPlasmaConversion`
|
|
144
|
+
* — define grades 1–5 on a stock module and climb from `0` like any other recipe.
|
|
145
|
+
*
|
|
146
|
+
* This is blueprint cost only. An experimental effect is a separate application, and it
|
|
147
|
+
* costs materials alone; combine its `getExperimentalEffectCost` result with
|
|
148
|
+
* `materials` here using {@link sumMaterials}, and `mercCoins` needs no such folding.
|
|
103
149
|
*
|
|
104
150
|
* The game writes three colliding ids for two different recipes, but each pair costs the
|
|
105
|
-
* same
|
|
106
|
-
*
|
|
151
|
+
* same at every grade. Either spelling therefore prices correctly without a fitted
|
|
152
|
+
* module; cross-catalogue tests pin that invariant.
|
|
107
153
|
*
|
|
108
154
|
* @param fdname - The blueprint id, e.g. `"FSD_LongRange"`, matched
|
|
109
155
|
* case-insensitively after trimming surrounding whitespace.
|
|
110
156
|
* @param grade - The target grade, `1`–`5`.
|
|
111
157
|
* @param currentGrade - The completed grade, `0`–`5`; defaults to `0` for an
|
|
112
158
|
* unengineered module.
|
|
113
|
-
* Only grades above it are charged; `currentGrade >= grade` costs nothing
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
159
|
+
* Only grades above it are charged; `currentGrade >= grade` costs nothing
|
|
160
|
+
* (`{ materials: [], mercCoins: 0 }`).
|
|
161
|
+
* @returns The summed materials and Merc Coin total, or `null` if no ordinary craft cost
|
|
162
|
+
* is catalogued for the blueprint and target grade. A blueprint that starts above
|
|
163
|
+
* grade 1 charges only the grades it defines. `mercCoins` is `0` where the recipe
|
|
164
|
+
* charges no currency, so `null` remains the one answer meaning "not catalogued".
|
|
117
165
|
* @throws {RangeError} If `grade` is not an integer from 1 through 5, or `currentGrade`
|
|
118
166
|
* is not an integer from 0 through 5.
|
|
167
|
+
* @throws {TypeError} If `fdname` is present and not a string. A nullish
|
|
168
|
+
* `fdname` is a miss, answered the way an unrecognised one is.
|
|
119
169
|
* @example
|
|
120
170
|
* ```ts
|
|
121
171
|
* import { getBlueprintCost } from '@elite-dangerous-almanac/core/ships/blueprint-costs';
|
|
@@ -123,8 +173,47 @@ declare function getBlueprintGradeCost(fdname: string, grade: number): readonly
|
|
|
123
173
|
* getBlueprintCost('FSD_LongRange', 5); // grades 1–5
|
|
124
174
|
* getBlueprintCost('FSD_LongRange', 5, 3); // grades 4 and 5 only
|
|
125
175
|
* getBlueprintCost('FSD_LongRange', 5, 4); // grade 5 progression only
|
|
176
|
+
*
|
|
177
|
+
* getBlueprintCost('FSD_LongRange', 5)?.mercCoins; // -> 0
|
|
178
|
+
* getBlueprintCost('RailGun_LongShot', 5, 1)?.mercCoins; // -> 415
|
|
179
|
+
* getBlueprintCost('FuelScoop_Efficiency', 5)?.mercCoins; // -> 350
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
declare function getBlueprintCost(fdname: string, grade: number, currentGrade?: number): BlueprintCost | null;
|
|
183
|
+
/**
|
|
184
|
+
* Merc Coin charged for **one roll** of a blueprint, keyed by grade (`"1"`–`"5"`).
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```ts
|
|
188
|
+
* import type { BlueprintMercCoinCosts } from '@elite-dangerous-almanac/core/ships/blueprint-costs';
|
|
189
|
+
*
|
|
190
|
+
* const costs: BlueprintMercCoinCosts = { '2': 5, '3': 10 };
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
type BlueprintMercCoinCosts = Readonly<Record<string, number>>;
|
|
194
|
+
/**
|
|
195
|
+
* The Merc Coin charged per roll by every blueprint that charges any, keyed by Frontier
|
|
196
|
+
* `fdname` and then grade.
|
|
197
|
+
*
|
|
198
|
+
* @remarks
|
|
199
|
+
* The raw catalogue behind {@link BlueprintCost.mercCoins}; reach for
|
|
200
|
+
* {@link getBlueprintCost} or {@link getBlueprintGradeCost} unless you want the table
|
|
201
|
+
* itself. A small subset of {@link BLUEPRINT_COSTS} — 25 of its ids, in two shapes.
|
|
202
|
+
* Twenty-one are the bespoke grade-2–5 recipes that only a Mercenary article, bought
|
|
203
|
+
* already at grade 1, can be taken through. The other four are ordinary
|
|
204
|
+
* engineering-menu recipes spanning grades 1–5 that happen to bill the currency too:
|
|
205
|
+
* `FuelScoop_Efficiency` and the three `*Laser_ThermalPlasmaConversion`. Every other
|
|
206
|
+
* blueprint is absent rather than zero. Merc Coin has no credit equivalent, so it is
|
|
207
|
+
* never folded into a material list.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```ts
|
|
211
|
+
* import { BLUEPRINT_MERC_COIN_COSTS } from '@elite-dangerous-almanac/core/ships/blueprint-costs';
|
|
212
|
+
*
|
|
213
|
+
* BLUEPRINT_MERC_COIN_COSTS['CargoRackS5C1_Extended']; // -> { '2': 5, '3': 10, '4': 15, '5': 30 }
|
|
214
|
+
* Object.hasOwn(BLUEPRINT_MERC_COIN_COSTS, 'FSD_LongRange'); // -> false
|
|
126
215
|
* ```
|
|
127
216
|
*/
|
|
128
|
-
declare
|
|
217
|
+
declare const BLUEPRINT_MERC_COIN_COSTS: Readonly<Record<string, BlueprintMercCoinCosts>>;
|
|
129
218
|
|
|
130
|
-
export { BLUEPRINT_COSTS, type BlueprintGradeCosts, getBlueprintCost, getBlueprintCosts, getBlueprintGradeCost };
|
|
219
|
+
export { BLUEPRINT_COSTS, BLUEPRINT_MERC_COIN_COSTS, type BlueprintCost, type BlueprintGradeCosts, type BlueprintMercCoinCosts, getBlueprintCost, getBlueprintCosts, getBlueprintGradeCost };
|