@elite-dangerous-almanac/core 0.2.1 → 0.2.2
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 +3 -2
- package/THIRD_PARTY_NOTICES.md +24 -2
- package/dist/astro/body-orbit.d.ts +174 -0
- package/dist/astro/body-orbit.js +1 -0
- package/dist/astro/body-orbit.js.map +1 -0
- package/dist/astro/body-physics.d.ts +228 -0
- package/dist/astro/body-physics.js +1 -0
- package/dist/astro/body-physics.js.map +1 -0
- package/dist/astro/body-rings.d.ts +223 -0
- package/dist/astro/body-rings.js +1 -0
- package/dist/astro/body-rings.js.map +1 -0
- package/dist/astro/codex-region-lookup.js +1 -1
- package/dist/astro/codex-region-lookup.js.map +1 -1
- package/dist/astro/index.d.ts +38 -1
- package/dist/astro/index.js +1 -1
- package/dist/astro/nebulae.d.ts +4 -4
- package/dist/astro/procedural-system.js +1 -1
- package/dist/astro/star-physics.d.ts +255 -0
- package/dist/astro/star-physics.js +1 -0
- package/dist/astro/star-physics.js.map +1 -0
- package/dist/body-scan-CEUYjCfH.d.ts +416 -0
- package/dist/{chunk-HUYYGTRM.js → chunk-3LZXB2MC.js} +1 -1
- package/dist/chunk-3RTUSDQF.js +1 -0
- package/dist/chunk-3RTUSDQF.js.map +1 -0
- package/dist/chunk-4OTQBHQL.js +1 -0
- package/dist/chunk-4OTQBHQL.js.map +1 -0
- package/dist/{chunk-MRTTQYT5.js → chunk-7EWZGDWY.js} +1 -1
- package/dist/{chunk-TBZJIQ5P.js → chunk-7TVFV3VO.js} +1 -1
- package/dist/chunk-7TVFV3VO.js.map +1 -0
- package/dist/chunk-7ZERP4TB.js +1 -0
- package/dist/{chunk-APEG4ZER.js.map → chunk-7ZERP4TB.js.map} +1 -1
- package/dist/chunk-B5VTFOK4.js +1 -0
- package/dist/chunk-B5VTFOK4.js.map +1 -0
- package/dist/chunk-DAQ3PJ4R.js +1 -0
- package/dist/chunk-DAQ3PJ4R.js.map +1 -0
- package/dist/chunk-GBTCWNO6.js +1 -0
- package/dist/chunk-GBTCWNO6.js.map +1 -0
- package/dist/chunk-NEXDA73Y.js +1 -0
- package/dist/chunk-NEXDA73Y.js.map +1 -0
- package/dist/chunk-P2MUFVJC.js +1 -0
- package/dist/chunk-P2MUFVJC.js.map +1 -0
- package/dist/{chunk-AAE4KZ2V.js → chunk-SS6XK336.js} +1 -1
- package/dist/{chunk-AAE4KZ2V.js.map → chunk-SS6XK336.js.map} +1 -1
- package/dist/chunk-TMXKC6JL.js +1 -0
- package/dist/chunk-TMXKC6JL.js.map +1 -0
- package/dist/chunk-ZZ376WHL.js +1 -0
- package/dist/chunk-ZZ376WHL.js.map +1 -0
- package/dist/commodities/commodities.d.ts +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/i18n/index.js +1 -1
- package/dist/materials/index.js +1 -1
- package/dist/materials/materials.d.ts +1 -1
- package/dist/materials/micro-resources-all.js +1 -1
- package/dist/materials/micro-resources.d.ts +1 -1
- package/dist/materials/micro-resources.js +1 -1
- package/dist/ships/build-metrics.d.ts +21 -232
- package/dist/ships/build-metrics.js +1 -1
- package/dist/ships/distributor.d.ts +1 -1
- package/dist/ships/heat.d.ts +1 -1
- package/dist/ships/index.d.ts +2 -2
- package/dist/ships/index.js +1 -1
- package/dist/ships/loadout-calculations.d.ts +2 -2
- package/dist/ships/mobility-capacitor.d.ts +1 -1
- package/dist/ships/modules-all.js +1 -1
- package/dist/ships/modules.d.ts +1 -1
- package/dist/ships/modules.js +1 -1
- package/dist/ships/pre-engineered-stats.d.ts +7 -5
- package/dist/ships/pre-engineered-stats.js +1 -1
- package/dist/ships/shield-capacitor.d.ts +1 -1
- package/dist/ships/shields.d.ts +1 -1
- package/dist/ships/ship-loadout.d.ts +71 -16
- package/dist/ships/ship-loadout.js +1 -1
- package/package.json +18 -3
- package/dist/chunk-6S36AVA4.js +0 -1
- package/dist/chunk-6S36AVA4.js.map +0 -1
- package/dist/chunk-APEG4ZER.js +0 -1
- package/dist/chunk-GVNTKCVF.js +0 -1
- package/dist/chunk-GVNTKCVF.js.map +0 -1
- package/dist/chunk-JET673E5.js +0 -1
- package/dist/chunk-JET673E5.js.map +0 -1
- package/dist/chunk-SG6YLUQ4.js +0 -1
- package/dist/chunk-SG6YLUQ4.js.map +0 -1
- package/dist/chunk-TBZJIQ5P.js.map +0 -1
- /package/dist/{chunk-HUYYGTRM.js.map → chunk-3LZXB2MC.js.map} +0 -0
- /package/dist/{chunk-MRTTQYT5.js.map → chunk-7EWZGDWY.js.map} +0 -0
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
import { SystemAddressInput } from './astro/system-address-input.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The shape a scanned body arrives in: {@link BodyProperties}, the physical body every
|
|
5
|
+
* calculation reads, and {@link BodyScanEvent}, that body plus the game journal's own
|
|
6
|
+
* `Scan` bookkeeping — with the records both nest.
|
|
7
|
+
*
|
|
8
|
+
* Types only. No catalogue, no parser, no computation, so importing costs nothing at
|
|
9
|
+
* runtime; `./astro` re-exports every symbol, which is why there is no subpath of its own.
|
|
10
|
+
* The orientation a reader needs lives on the two interfaces themselves.
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* One step up a body's parent chain, as one entry of {@link BodyScanEvent.Parents}.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* **Exactly one key is present**, and its value is that parent's
|
|
20
|
+
* {@link BodyScanEvent.BodyID} — so a moon orbiting a planet reads `{ Planet: 4 }`.
|
|
21
|
+
* The four keys are the four kinds of thing a body can orbit; `Null` is a barycentre,
|
|
22
|
+
* which is a point rather than a body and has no scan of its own.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import type { BodyParent } from '@elite-dangerous-almanac/core/astro';
|
|
27
|
+
*
|
|
28
|
+
* // A moon of the second planet, which orbits the main star.
|
|
29
|
+
* const parents: readonly BodyParent[] = [{ Planet: 4 }, { Star: 0 }];
|
|
30
|
+
*
|
|
31
|
+
* Object.keys(parents[0] ?? {})[0]; // -> 'Planet'
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
interface BodyParent {
|
|
35
|
+
/** `BodyID` of the star this body orbits. */
|
|
36
|
+
readonly Star?: number;
|
|
37
|
+
/** `BodyID` of the planet this body orbits — the body is a moon of it. */
|
|
38
|
+
readonly Planet?: number;
|
|
39
|
+
/** `BodyID` of the ring this body sits in — written for a belt cluster. */
|
|
40
|
+
readonly Ring?: number;
|
|
41
|
+
/** `BodyID` of the barycentre this body orbits. A point, not a scannable body. */
|
|
42
|
+
readonly Null?: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* One ring or belt around a body, as one entry of {@link BodyProperties.Rings}.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* The same shape covers a planet's rings and a star's asteroid belts; `Name` tells them
|
|
49
|
+
* apart, ending in `" A Ring"` or `" A Belt"`. Radii are **metres** from the body's
|
|
50
|
+
* centre, and `MassMT` is **megatonnes** — the one mass in this module that is neither
|
|
51
|
+
* solar nor Earth masses.
|
|
52
|
+
*/
|
|
53
|
+
interface BodyRing {
|
|
54
|
+
/** The ring's in-game name, e.g. `"Synuefe EN-H d11-96 A 1 A Ring"`. */
|
|
55
|
+
readonly Name: string;
|
|
56
|
+
/**
|
|
57
|
+
* The ring's material class, as the game's internal token: `"eRingClass_Rocky"`,
|
|
58
|
+
* `"eRingClass_Icy"`, `"eRingClass_MetalRich"` or `"eRingClass_Metalic"`.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* `"eRingClass_Metalic"` is spelt that way by the game. It is Frontier's token, not a
|
|
62
|
+
* typo introduced here, and a consumer matching on the string must spell it likewise.
|
|
63
|
+
*/
|
|
64
|
+
readonly RingClass: string;
|
|
65
|
+
/** The ring's total mass, in megatonnes. */
|
|
66
|
+
readonly MassMT: number;
|
|
67
|
+
/** Inner radius, in metres from the body's centre. */
|
|
68
|
+
readonly InnerRad: number;
|
|
69
|
+
/** Outer radius, in metres from the body's centre. */
|
|
70
|
+
readonly OuterRad: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* One gas in a body's atmosphere, as one entry of
|
|
74
|
+
* {@link BodyProperties.AtmosphereComposition}.
|
|
75
|
+
*/
|
|
76
|
+
interface AtmosphereComponent {
|
|
77
|
+
/** The gas, as the game names it, e.g. `"Nitrogen"`, `"SulphurDioxide"`. */
|
|
78
|
+
readonly Name: string;
|
|
79
|
+
/** Share of the atmosphere, as a **percentage** — `99.124542`, not `0.99124542`. */
|
|
80
|
+
readonly Percent: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* One material available at a landable body's surface, as one entry of
|
|
84
|
+
* {@link BodyProperties.Materials}.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* `Name` is the journal's material symbol in lower case, which is what
|
|
88
|
+
* `getMaterialBySymbol` (`../materials`) takes — the same spelling a `MaterialCollected`
|
|
89
|
+
* line uses.
|
|
90
|
+
*/
|
|
91
|
+
interface SurfaceMaterial {
|
|
92
|
+
/** The material's journal symbol, lower-cased, e.g. `"iron"`, `"sulphur"`. */
|
|
93
|
+
readonly Name: string;
|
|
94
|
+
/** The material's display name, when the game localised it into the line. */
|
|
95
|
+
readonly Name_Localised?: string;
|
|
96
|
+
/** Share of the body's surface materials, as a **percentage** out of 100. */
|
|
97
|
+
readonly Percent: number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* What a planet or moon is made of, as {@link BodyProperties.Composition}.
|
|
101
|
+
*
|
|
102
|
+
* @remarks
|
|
103
|
+
* Each share is a **fraction of 1**, not a percentage, and the three sum to 1. This is
|
|
104
|
+
* the body's bulk composition; {@link BodyProperties.Materials} is the separate question
|
|
105
|
+
* of what can be collected from its surface.
|
|
106
|
+
*/
|
|
107
|
+
interface BodyComposition {
|
|
108
|
+
/** Ice share of the body, 0–1. */
|
|
109
|
+
readonly Ice: number;
|
|
110
|
+
/** Rock share of the body, 0–1. */
|
|
111
|
+
readonly Rock: number;
|
|
112
|
+
/** Metal share of the body, 0–1. */
|
|
113
|
+
readonly Metal: number;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The physical body a scan describes — everything a calculation reads, and nothing that
|
|
117
|
+
* names the journal line it arrived on.
|
|
118
|
+
*
|
|
119
|
+
* @remarks
|
|
120
|
+
* {@link BodyScanEvent} extends this with the journal's own bookkeeping — `event`,
|
|
121
|
+
* `timestamp`, `ScanType`, `BodyName`, `BodyID`, `StarSystem`, `SystemAddress`,
|
|
122
|
+
* `DistanceFromArrivalLS`, `Parents` and the discovery flags. None of that is physics, so
|
|
123
|
+
* none of it is required here: every field below is optional, and a body assembled from a
|
|
124
|
+
* database row, an EDSM or Spansh record, or a literal in a test is as good an input as a
|
|
125
|
+
* captured line. A `BodyScanEvent` is a `BodyProperties`, so a parsed journal line passes
|
|
126
|
+
* to every calculation unchanged.
|
|
127
|
+
*
|
|
128
|
+
* Each calculation states which fields it needs and returns `null` when one is missing —
|
|
129
|
+
* see `./body-physics`, `./body-orbit`, `./body-rings` and `./star-physics`.
|
|
130
|
+
*
|
|
131
|
+
* Units are the journal's throughout: metres, seconds, kelvin, pascals, Earth masses for
|
|
132
|
+
* a planet and solar masses for a star. Angles are degrees except
|
|
133
|
+
* {@link BodyProperties.AxialTilt | AxialTilt}, which is radians.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* Only the fields a calculation reads need be present.
|
|
137
|
+
*
|
|
138
|
+
* ```ts
|
|
139
|
+
* import type { BodyProperties } from '@elite-dangerous-almanac/core/astro';
|
|
140
|
+
* import { bulkDensity } from '@elite-dangerous-almanac/core/astro/body-physics';
|
|
141
|
+
*
|
|
142
|
+
* const earthLike: BodyProperties = { MassEM: 1, Radius: 6_371_000 };
|
|
143
|
+
*
|
|
144
|
+
* bulkDensity(earthLike); // -> 5513.2…
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
interface BodyProperties {
|
|
148
|
+
/** Semi-major axis of the body's orbit, in **metres**. */
|
|
149
|
+
readonly SemiMajorAxis?: number;
|
|
150
|
+
/** Orbital eccentricity, 0 for a circular orbit and approaching 1 for a long ellipse. */
|
|
151
|
+
readonly Eccentricity?: number;
|
|
152
|
+
/** Orbital inclination, in **degrees**. */
|
|
153
|
+
readonly OrbitalInclination?: number;
|
|
154
|
+
/** Argument of periapsis, in **degrees**. */
|
|
155
|
+
readonly Periapsis?: number;
|
|
156
|
+
/** Time to complete one orbit, in **seconds**. */
|
|
157
|
+
readonly OrbitalPeriod?: number;
|
|
158
|
+
/** Longitude of the ascending node, in **degrees**. */
|
|
159
|
+
readonly AscendingNode?: number;
|
|
160
|
+
/** Mean anomaly at the moment the body was observed, in **degrees**. */
|
|
161
|
+
readonly MeanAnomaly?: number;
|
|
162
|
+
/**
|
|
163
|
+
* Time to complete one rotation, in **seconds**. Negative when the body rotates
|
|
164
|
+
* retrograde.
|
|
165
|
+
*/
|
|
166
|
+
readonly RotationPeriod?: number;
|
|
167
|
+
/**
|
|
168
|
+
* Axial tilt, in **radians** — the one angle here that is not degrees.
|
|
169
|
+
*/
|
|
170
|
+
readonly AxialTilt?: number;
|
|
171
|
+
/** Whether the body keeps one face to its parent. */
|
|
172
|
+
readonly TidalLock?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* The star's spectral class, e.g. `"G"`, `"M"`, `"TTS"` (T Tauri), `"N"` (neutron
|
|
175
|
+
* star), `"H"` (black hole). Present only on a star's line, and the surest way to
|
|
176
|
+
* tell one.
|
|
177
|
+
*/
|
|
178
|
+
readonly StarType?: string;
|
|
179
|
+
/** The spectral subclass, 0–9, hotter at 0. */
|
|
180
|
+
readonly Subclass?: number;
|
|
181
|
+
/** The star's mass, in **solar masses**. */
|
|
182
|
+
readonly StellarMass?: number;
|
|
183
|
+
/** The star's absolute magnitude — smaller is brighter, and it can be negative. */
|
|
184
|
+
readonly AbsoluteMagnitude?: number;
|
|
185
|
+
/** The star's age, in **millions of years**. */
|
|
186
|
+
readonly Age_MY?: number;
|
|
187
|
+
/** The star's luminosity class, e.g. `"V"`, `"Va"`, `"VI"`. */
|
|
188
|
+
readonly Luminosity?: string;
|
|
189
|
+
/**
|
|
190
|
+
* The body's class, e.g. `"High metal content body"`, `"Icy body"`,
|
|
191
|
+
* `"Earthlike body"`, `"Water world"`, `"Sudarsky class I gas giant"`. Present only
|
|
192
|
+
* on a planet's or moon's line.
|
|
193
|
+
*/
|
|
194
|
+
readonly PlanetClass?: string;
|
|
195
|
+
/**
|
|
196
|
+
* Whether the body's terraforming potential has been realised: `""` when there is
|
|
197
|
+
* none, `"Terraformable"` when it is a candidate, `"Terraformed"` when it already is.
|
|
198
|
+
*/
|
|
199
|
+
readonly TerraformState?: string;
|
|
200
|
+
/**
|
|
201
|
+
* The atmosphere as the game describes it in full, e.g.
|
|
202
|
+
* `"thin sulphur dioxide atmosphere"`. `""` when the body has none.
|
|
203
|
+
*/
|
|
204
|
+
readonly Atmosphere?: string;
|
|
205
|
+
/**
|
|
206
|
+
* The atmosphere's dominant gas as a bare token, e.g. `"Nitrogen"`,
|
|
207
|
+
* `"SulphurDioxide"`, `"None"`.
|
|
208
|
+
*
|
|
209
|
+
* @remarks
|
|
210
|
+
* The token drops the density and temperature that {@link BodyProperties.Atmosphere | Atmosphere}
|
|
211
|
+
* spells out, so `"thin nitrogen atmosphere"` and `"hot thick nitrogen atmosphere"`
|
|
212
|
+
* share one `AtmosphereType`. Match on this and read the other for the qualifiers.
|
|
213
|
+
*/
|
|
214
|
+
readonly AtmosphereType?: string;
|
|
215
|
+
/** What the atmosphere is made of, by percentage. */
|
|
216
|
+
readonly AtmosphereComposition?: readonly AtmosphereComponent[];
|
|
217
|
+
/**
|
|
218
|
+
* The body's volcanism as the game describes it, e.g.
|
|
219
|
+
* `"minor silicate vapour geysers volcanism"`. `""` when the body has none.
|
|
220
|
+
*/
|
|
221
|
+
readonly Volcanism?: string;
|
|
222
|
+
/** The body's mass, in **Earth masses**. */
|
|
223
|
+
readonly MassEM?: number;
|
|
224
|
+
/**
|
|
225
|
+
* Surface gravity, in **m/s²** — divide by `9.80665` for the `g` figure the game's
|
|
226
|
+
* own UI shows.
|
|
227
|
+
*/
|
|
228
|
+
readonly SurfaceGravity?: number;
|
|
229
|
+
/**
|
|
230
|
+
* Atmospheric pressure at the surface, in **pascals** — divide by `101325` for
|
|
231
|
+
* atmospheres. `0` on an airless body.
|
|
232
|
+
*/
|
|
233
|
+
readonly SurfacePressure?: number;
|
|
234
|
+
/** Whether a ship can land on the body. */
|
|
235
|
+
readonly Landable?: boolean;
|
|
236
|
+
/** The body's bulk composition, when the scan resolved it. */
|
|
237
|
+
readonly Composition?: BodyComposition;
|
|
238
|
+
/**
|
|
239
|
+
* The materials collectable at the surface, by percentage.
|
|
240
|
+
*
|
|
241
|
+
* @remarks
|
|
242
|
+
* Written for a landable body. Each `Name` is a journal material symbol that
|
|
243
|
+
* `getMaterialBySymbol` (`../materials`) resolves.
|
|
244
|
+
*/
|
|
245
|
+
readonly Materials?: readonly SurfaceMaterial[];
|
|
246
|
+
/**
|
|
247
|
+
* The body's radius, in **metres** — for a star as much as for a planet.
|
|
248
|
+
*/
|
|
249
|
+
readonly Radius?: number;
|
|
250
|
+
/** Surface — or, for a star, photospheric — temperature, in **kelvin**. */
|
|
251
|
+
readonly SurfaceTemperature?: number;
|
|
252
|
+
/** The body's rings and belts, absent when it has none. */
|
|
253
|
+
readonly Rings?: readonly BodyRing[];
|
|
254
|
+
/**
|
|
255
|
+
* How rich the body's rings are, e.g. `"PristineResources"`, `"MajorResources"`,
|
|
256
|
+
* `"CommonResources"`, `"LowResources"`, `"DepletedResources"` — the game's reserve
|
|
257
|
+
* levels, each suffixed `Resources`.
|
|
258
|
+
*
|
|
259
|
+
* @remarks
|
|
260
|
+
* Written only when the body has rings, and it describes those rings rather than the
|
|
261
|
+
* body itself.
|
|
262
|
+
*/
|
|
263
|
+
readonly ReserveLevel?: string;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* A journal `Scan` event — one scanned star, planet, moon or belt cluster, and the
|
|
267
|
+
* library's import shape for body data.
|
|
268
|
+
*
|
|
269
|
+
* @remarks
|
|
270
|
+
* Elite Dangerous writes one `Scan` line per body whenever the discovery scanner, the FSS
|
|
271
|
+
* or a nav beacon resolves it, and that line is the community's lingua franca for bodies:
|
|
272
|
+
* EDDN relays it, EDSM and Spansh store it, every journal-reading app already holds it.
|
|
273
|
+
* So it is what this library takes in, field for field — the journal's own names,
|
|
274
|
+
* capitalisation and units — and a parsed line is already this type:
|
|
275
|
+
*
|
|
276
|
+
* ```ts
|
|
277
|
+
* const scan = JSON.parse(line) as BodyScanEvent;
|
|
278
|
+
* ```
|
|
279
|
+
*
|
|
280
|
+
* **Units are the journal's, and they are not the ones the game's UI shows.** Radii and
|
|
281
|
+
* orbital distances are metres, not light-seconds; pressure is pascals, not atmospheres;
|
|
282
|
+
* surface gravity is m/s², not g; `AxialTilt` is radians while every other angle is
|
|
283
|
+
* degrees. Every field below says which, because getting this wrong is silent — a
|
|
284
|
+
* plausible number in the wrong scale.
|
|
285
|
+
*
|
|
286
|
+
* **Almost every field is optional, because almost every field is conditional.** A star's
|
|
287
|
+
* line carries no {@link BodyProperties.PlanetClass | PlanetClass}, a planet's no
|
|
288
|
+
* {@link BodyProperties.StarType | StarType}, a belt cluster's little beyond its identity, and a body
|
|
289
|
+
* with no rings no {@link BodyProperties.ReserveLevel | ReserveLevel}. Only `ScanType`, `BodyName`,
|
|
290
|
+
* `BodyID`, `StarSystem`, `SystemAddress`, `DistanceFromArrivalLS`, `WasDiscovered` and
|
|
291
|
+
* `WasMapped` are written for every body. Treat a missing field as "not written for this
|
|
292
|
+
* body, or not resolved by this scan" — never as a zero.
|
|
293
|
+
*
|
|
294
|
+
* **A body has no id64 of its own.** {@link BodyScanEvent.SystemAddress | SystemAddress} identifies the
|
|
295
|
+
* system and {@link BodyScanEvent.BodyID | BodyID} the body within it; the pair is the identity to
|
|
296
|
+
* store and join on.
|
|
297
|
+
*
|
|
298
|
+
* `event` and `timestamp` name the journal line rather than the body, and are optional so
|
|
299
|
+
* that a record reassembled from a database or an EDDN message is still this type.
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* A parsed line is already the interface, and its address goes straight into the rest of
|
|
303
|
+
* the astro API.
|
|
304
|
+
*
|
|
305
|
+
* ```ts
|
|
306
|
+
* import type { BodyScanEvent } from '@elite-dangerous-almanac/core/astro';
|
|
307
|
+
* import { ProceduralSystem } from '@elite-dangerous-almanac/core/astro/procedural-system';
|
|
308
|
+
*
|
|
309
|
+
* const scan: BodyScanEvent = {
|
|
310
|
+
* event: 'Scan',
|
|
311
|
+
* ScanType: 'Detailed',
|
|
312
|
+
* BodyName: 'Synuefe EN-H d11-96 A 1',
|
|
313
|
+
* BodyID: 3,
|
|
314
|
+
* StarSystem: 'Synuefe EN-H d11-96',
|
|
315
|
+
* SystemAddress: 3309179996515,
|
|
316
|
+
* DistanceFromArrivalLS: 543.2,
|
|
317
|
+
* WasDiscovered: false,
|
|
318
|
+
* WasMapped: false,
|
|
319
|
+
* };
|
|
320
|
+
*
|
|
321
|
+
* ProceduralSystem.fromSystemAddress(scan.SystemAddress).massCode; // -> 'd'
|
|
322
|
+
* ```
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* Which kind of body a line describes is told by which fields it carries: `StarType` for
|
|
326
|
+
* a star, `PlanetClass` for a planet or moon, neither for a belt cluster.
|
|
327
|
+
*
|
|
328
|
+
* ```ts
|
|
329
|
+
* import type { BodyScanEvent } from '@elite-dangerous-almanac/core/astro';
|
|
330
|
+
*
|
|
331
|
+
* declare const scan: BodyScanEvent;
|
|
332
|
+
*
|
|
333
|
+
* const kind =
|
|
334
|
+
* scan.StarType !== undefined
|
|
335
|
+
* ? 'star'
|
|
336
|
+
* : scan.PlanetClass !== undefined
|
|
337
|
+
* ? 'planet'
|
|
338
|
+
* : 'belt cluster or barycentre';
|
|
339
|
+
* ```
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* A landable body's {@link BodyProperties.Materials | Materials} name journal material symbols, which
|
|
343
|
+
* the materials catalogue reads directly.
|
|
344
|
+
*
|
|
345
|
+
* ```ts
|
|
346
|
+
* import { getMaterialBySymbol } from '@elite-dangerous-almanac/core/materials';
|
|
347
|
+
*
|
|
348
|
+
* getMaterialBySymbol('sulphur')?.name; // -> 'Sulphur'
|
|
349
|
+
* ```
|
|
350
|
+
*/
|
|
351
|
+
interface BodyScanEvent extends BodyProperties {
|
|
352
|
+
/** `"Scan"` when a journal line supplied it. */
|
|
353
|
+
readonly event?: string;
|
|
354
|
+
/** When the scan happened, ISO 8601 in UTC, e.g. `"2026-08-26T21:04:11Z"`. */
|
|
355
|
+
readonly timestamp?: string;
|
|
356
|
+
/**
|
|
357
|
+
* How the body was scanned: `"AutoScan"` (passive, on approach or from the discovery
|
|
358
|
+
* scanner's honk), `"Basic"`, `"Detailed"` (resolved in the FSS or by flying to the
|
|
359
|
+
* body) or `"NavBeaconDetail"` (read off a populated system's nav beacon).
|
|
360
|
+
*
|
|
361
|
+
* @remarks
|
|
362
|
+
* This is the field that decides how much of the rest is present. A `"Detailed"` or
|
|
363
|
+
* `"NavBeaconDetail"` line is the full record; an `"AutoScan"` of a distant body may
|
|
364
|
+
* carry little more than its identity and orbit.
|
|
365
|
+
*/
|
|
366
|
+
readonly ScanType: string;
|
|
367
|
+
/** The body's in-game name, e.g. `"Synuefe EN-H d11-96 A 1"`. */
|
|
368
|
+
readonly BodyName: string;
|
|
369
|
+
/**
|
|
370
|
+
* The body's id within its system, unique and stable there, with the system's first
|
|
371
|
+
* star at 0.
|
|
372
|
+
*
|
|
373
|
+
* @remarks
|
|
374
|
+
* A body has no galaxy-wide id of its own: `SystemAddress` + `BodyID` is the identity
|
|
375
|
+
* to store and join on. It is also what {@link BodyParent} entries point at.
|
|
376
|
+
*/
|
|
377
|
+
readonly BodyID: number;
|
|
378
|
+
/** The system's name, e.g. `"Synuefe EN-H d11-96"`. */
|
|
379
|
+
readonly StarSystem: string;
|
|
380
|
+
/**
|
|
381
|
+
* The system's `id64` address.
|
|
382
|
+
*
|
|
383
|
+
* @remarks
|
|
384
|
+
* Typed as {@link SystemAddressInput} rather than `number`, so the value survives
|
|
385
|
+
* however the line was parsed: `JSON.parse` yields a `number`, a lossless parser a
|
|
386
|
+
* `bigint`, a database column a decimal `string`. All three pass straight into
|
|
387
|
+
* `decodeSystemAddress`, `ProceduralSystem.fromSystemAddress` and the permit-lock
|
|
388
|
+
* lookups. Addresses reach bit 55, so a `number` beyond `2^53 - 1` has already been
|
|
389
|
+
* rounded — those entry points reject one rather than answer for the wrong system.
|
|
390
|
+
*/
|
|
391
|
+
readonly SystemAddress: SystemAddressInput;
|
|
392
|
+
/**
|
|
393
|
+
* Distance from the system's arrival point, in **light-seconds**. The main star reads
|
|
394
|
+
* `0`.
|
|
395
|
+
*/
|
|
396
|
+
readonly DistanceFromArrivalLS: number;
|
|
397
|
+
/**
|
|
398
|
+
* The body's parent chain, nearest first and ending at the system's root — so a moon
|
|
399
|
+
* reads `[{ Planet: … }, { Star: 0 }]`.
|
|
400
|
+
*
|
|
401
|
+
* @remarks
|
|
402
|
+
* Absent for a body that orbits nothing, i.e. a single-star system's main star.
|
|
403
|
+
*/
|
|
404
|
+
readonly Parents?: readonly BodyParent[];
|
|
405
|
+
/** Whether someone had already discovered the body before this scan. */
|
|
406
|
+
readonly WasDiscovered: boolean;
|
|
407
|
+
/** Whether someone had already surface-mapped the body before this scan. */
|
|
408
|
+
readonly WasMapped: boolean;
|
|
409
|
+
/**
|
|
410
|
+
* Whether someone had already set foot on the body. Written since Odyssey, and only
|
|
411
|
+
* for a body that can be walked on.
|
|
412
|
+
*/
|
|
413
|
+
readonly WasFootfalled?: boolean;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export type { AtmosphereComponent as A, BodyComposition as B, SurfaceMaterial as S, BodyParent as a, BodyProperties as b, BodyRing as c, BodyScanEvent as d };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ALL_MODULES}from"./chunk-
|
|
1
|
+
import{ALL_MODULES}from"./chunk-7ZERP4TB.js";import{findInKeyIndex,findByKey,filterByKey,createKeyIndex}from"./chunk-BKWLI44T.js";var MODULES_BY_SYMBOL=/* @__PURE__ */createKeyIndex(ALL_MODULES,"symbol");function builtInModuleBySymbol(symbol,label){return findInKeyIndex(MODULES_BY_SYMBOL,symbol,label)}function getModuleBySymbol(symbol,modules=ALL_MODULES){return modules===ALL_MODULES?builtInModuleBySymbol(symbol,"getModuleBySymbol: symbol"):findByKey(modules,"symbol",symbol,"getModuleBySymbol: symbol")}function getModulesByName(name,modules=ALL_MODULES){return filterByKey(modules,"name",name,"getModulesByName: name")}function getBulkheadsForShip(ship,modules=ALL_MODULES){return filterByKey(modules,"ship",ship,"getBulkheadsForShip: ship")}export{builtInModuleBySymbol,getBulkheadsForShip,getModuleBySymbol,getModulesByName};//# sourceMappingURL=chunk-3LZXB2MC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cellBankSummary,shieldRecovery}from"./chunk-JMAXSXXQ.js";import{loadoutInternals,fittedThrusterParamsFor,preEngineeredVariantFor,powerConsumerFor,powerAvailable,heatInputResultFor,completeResult,cellBankInputsFor,armourInputFor,weaponStatsFor,weaponsCapacitorInputFor,mobilityInputResultFor,shieldInputResultFor,shieldCapacitorInputResultFor,shieldRecoveryInputResultFor,distributorInputResultFor,incompleteResult}from"./chunk-SS6XK336.js";import{shieldMetrics}from"./chunk-5VWACBTN.js";import{weaponsCapacitorMetrics}from"./chunk-M4FZRDAH.js";import{powerBudget}from"./chunk-GGQMIQPC.js";import{isNonOutfittingSlot,isBuiltInHullModule,orderBySlotLayout}from"./chunk-4OTQBHQL.js";import{weaponMetrics,sumWeaponMetrics}from"./chunk-37JIMWLK.js";import{shieldCapacitorMetrics}from"./chunk-XQJERZUS.js";import{mobilityCapacitorMetrics}from"./chunk-VEEBJFJ7.js";import{mobilityMetrics}from"./chunk-A4QKXXZD.js";import{getExperimentalEffectCost}from"./chunk-CJK2IBI2.js";import{heatMetrics}from"./chunk-6HA2YIKW.js";import{frameShiftDriveMassFactor,singleJumpRange,fuelPerJump,totalRange}from"./chunk-VTMCSCXV.js";import{calculateUnladenMass}from"./chunk-DCB4COCL.js";import{getBlueprintCost}from"./chunk-MTJ4MS7W.js";import{distributorMetrics}from"./chunk-M2TCZKRT.js";import{sumMaterials}from"./chunk-CJQ37JII.js";import{ammunitionCapacity}from"./chunk-AA3K5XUE.js";import{armourMetrics}from"./chunk-Q5ALV3DI.js";import{requirePips,requireFiniteNonNegative}from"./chunk-65FZECUX.js";import{deepFreeze}from"./chunk-DURKO7JU.js";var FACADE="BuildMetrics";function requireLoadOptions(scope,options){for(const field of["fuel","cargo"]){const value=options[field];if(value!==void 0)requireFiniteNonNegative(scope,field,value)}}var BuildMetrics=class _BuildMetrics{#build;#state;constructor(build,state){this.#build=build;this.#state=state}static of(build){return new _BuildMetrics(build,loadoutInternals(build,`${FACADE}.of: build`))}loadout(){return this.#build}frameShiftDrive(){const drive=this.#state.resolveDrive();if(drive===null){throw new TypeError(`${FACADE}: build has no frame shift drive`)}return drive}thrusters(){return fittedThrusterParamsFor(this.#state.modules(),this.#state.statsFor)}frameShiftDriveMassFactor(options={}){requireLoadOptions(`${FACADE}.frameShiftDriveMassFactor`,options);return frameShiftDriveMassFactor(this.#loadedMass(options.cargo??0),options.fuel??this.#build.fuelCapacity.main,this.frameShiftDrive())}maxJumpRange(){const fsd=this.frameShiftDrive();return singleJumpRange(this.#loadedMass(0),this.#maxJumpFuel(fsd),fsd)}jumpRange(options={}){requireLoadOptions(`${FACADE}.jumpRange`,options);return singleJumpRange(this.#loadedMass(options.cargo??0),options.fuel??this.#build.fuelCapacity.main,this.frameShiftDrive())}ladenJumpRange(){return this.jumpRange({cargo:this.#build.cargoCapacity})}fuelPerJump(distance,options={}){requireLoadOptions(`${FACADE}.fuelPerJump`,options);return fuelPerJump(distance,this.#loadedMass(options.cargo??0),options.fuel??this.#build.fuelCapacity.main,this.frameShiftDrive())}totalRange(options={}){requireLoadOptions(`${FACADE}.totalRange`,options);return totalRange(this.#loadedMass(options.cargo??0),options.fuel??this.#build.fuelCapacity.main,this.frameShiftDrive())}standardLoadResult(load){return this.#standardLoad(load)}jumpRangeSummary(){const maximum=this.#require(this.standardLoadResult("maximum"),"maximum load");const unladen=this.#require(this.standardLoadResult("unladen"),"unladen load");const laden=this.#require(this.standardLoadResult("laden"),"laden load");return{max:this.jumpRange(maximum),unladen:this.jumpRange(unladen),laden:this.jumpRange(laden),totalMax:this.totalRange(maximum),totalUnladen:this.totalRange(unladen),totalLaden:this.totalRange(laden)}}buildMass(options={}){requireLoadOptions(`${FACADE}.buildMass`,options);const unladen=this.#build.unladenMass;const fuel=options.fuel??this.#build.fuelCapacity.main;const cargo=options.cargo??0;return Object.freeze({hull:this.#state.ship.hullMass,modules:calculateUnladenMass(0,this.#state.calculationModules()),unladen:unladen,fuel:fuel,cargo:cargo,total:unladen+fuel+cargo})}buildCost(){const hull=this.#state.ship.hullCost;let modules=0;let mercCoins=0;const unpriced=[];const materials=[];for(const module of this.#state.modules()){const stats=this.#state.statsFor(module);if(stats?.cost!==void 0){modules+=stats.cost}else if(stats!==null||!isNonOutfittingSlot(module.Slot)&&!isBuiltInHullModule(module)){unpriced.push({slot:module.Slot,symbol:module.Item})}const variant=preEngineeredVariantFor(module);mercCoins+=variant?.mercCoinCost??0;const engineering=module.Engineering;if(!engineering)continue;const grade=engineering.Level;const bought=variant?.grade??0;if(Number.isInteger(grade)&&grade>bought&&grade<=5){const climb=getBlueprintCost(engineering.BlueprintName,grade,bought);if(climb){materials.push(climb.materials);mercCoins+=climb.mercCoins}}const experimental=engineering.ExperimentalEffect;if(experimental!==void 0&&experimental.toLowerCase()!==variant?.experimentalEffectSymbol?.toLowerCase()){const cost=getExperimentalEffectCost(experimental);if(cost)materials.push(cost)}}return deepFreeze({credits:{total:hull+modules,hull:hull,modules:modules,rebuy:Math.trunc((hull+modules)*.05),unpriced:unpriced},mercCoins:mercCoins,materials:sumMaterials(...materials)})}powerBudget(){const modules=this.#state.modules();const consumers=[];for(const module of modules){const consumer=powerConsumerFor(module,this.#state.statsFor(module));if(consumer)consumers.push(consumer)}return powerBudget(powerAvailable(modules,this.#state.statsFor),consumers)}heatMetricsResult(){const input=heatInputResultFor(this.#state.ship,this.#state.effectiveModules(),this.powerBudget(),this.#state.statsFor);return input.complete?completeResult(heatMetrics(input.value)):input}mobilityMetricsResult(options={}){return this.#mobility(options)}mobilityCapacitorMetricsResult(options={}){return this.#mobilityCapacitor(options)}shieldMetricsResult(){return this.#shields()}shieldCapacitorMetricsResult(options={}){return this.#shieldCapacitor(options)}shieldRecoveryResult(options={}){return this.#recovery(options)}cellBanks(){return cellBankSummary(orderBySlotLayout(cellBankInputsFor(this.#state.modules(),this.powerBudget(),this.#state.statsFor),this.#state.layout(),bank=>bank.slot))}armourMetrics(){return armourMetrics(armourInputFor(this.#state.ship,this.#state.modules(),this.#state.statsFor))}weaponMetrics(){const weapons=[];for(const module of this.#state.modules()){const record=this.#state.statsFor(module);const stats=weaponStatsFor(this.#state.effectiveModule(module),record);if(!stats)continue;weapons.push({slot:module.Slot,symbol:module.Item,name:record?.name??module.Item,enabled:module.On!==false,metrics:weaponMetrics(stats),ammunition:ammunitionCapacity(stats),...stats.maximumRange===void 0?{}:{maximumRange:stats.maximumRange},...stats.falloffRange===void 0?{}:{falloffRange:stats.falloffRange},...stats.projectileRange===void 0?{}:{projectileRange:{...stats.projectileRange}},...stats.armourPiercing===void 0?{}:{armourPiercing:stats.armourPiercing}})}const orderedWeapons=orderBySlotLayout(weapons,this.#state.layout(),weapon=>weapon.slot);return{weapons:orderedWeapons,total:sumWeaponMetrics(orderedWeapons.filter(weapon=>weapon.enabled).map(weapon=>weapon.metrics))}}weaponsCapacitorMetrics(options={}){const weaponsPips=requirePips(`${FACADE}.weaponsCapacitorMetrics`,"weaponsPips",options.weaponsPips??4);return weaponsCapacitorMetrics(weaponsCapacitorInputFor(this.#state.effectiveModules(),weaponsPips,this.powerBudget(),this.#state.statsFor))}distributorMetricsResult(options={}){return this.#distributor(options)}#mobility(options){const input=this.#mobilityInput(`${FACADE}.mobilityMetricsResult`,options);return input.complete?completeResult(mobilityMetrics(input.value)):input}#mobilityCapacitor(options){const scope=`${FACADE}.mobilityCapacitorMetricsResult`;const enginesPips=requirePips(scope,"enginesPips",options.enginesPips??4);const input=this.#mobilityInput(scope,options);return input.complete?completeResult(mobilityCapacitorMetrics({...input.value,enginesPips:enginesPips})):input}#mobilityInput(scope,options){requireLoadOptions(scope,options);return mobilityInputResultFor(this.#state.ship,this.#state.modules(),()=>this.powerBudget(),()=>this.#loadedMass(options.cargo??0)+(options.fuel??this.#state.statedMainFuel()??this.#build.fuelCapacity.main),this.#state.statsFor)}#shields(){const input=shieldInputResultFor(this.#state.ship,this.#state.modules(),()=>this.powerBudget(),this.#state.statsFor);return input.complete?completeResult(shieldMetrics(input.value)):input}#shieldCapacitor(options){const systemsPips=requirePips(`${FACADE}.shieldCapacitorMetricsResult`,"systemsPips",options.systemsPips??4);const input=shieldCapacitorInputResultFor(this.#state.ship,this.#state.modules(),()=>this.powerBudget(),systemsPips,this.#state.statsFor);return input.complete?completeResult(shieldCapacitorMetrics(input.value)):input}#recovery(options){const systemsPips=requirePips(`${FACADE}.shieldRecoveryResult`,"systemsPips",options.systemsPips??4);const input=shieldRecoveryInputResultFor(this.#state.ship,this.#state.modules(),()=>this.powerBudget(),systemsPips,this.#state.statsFor);return input.complete?completeResult(shieldRecovery(input.value)):input}#distributor(options){const scope=`${FACADE}.distributorMetricsResult`;const pips={systemsPips:requirePips(scope,"systemsPips",options.systemsPips??4),enginesPips:requirePips(scope,"enginesPips",options.enginesPips??4),weaponsPips:requirePips(scope,"weaponsPips",options.weaponsPips??4)};const input=distributorInputResultFor(this.#state.effectiveModules(),pips,this.powerBudget(),this.#state.statsFor);return input.complete?completeResult(distributorMetrics(input.value)):input}#standardLoad(load){if(load!=="maximum"&&load!=="unladen"&&load!=="laden"){throw new RangeError(`${FACADE}.standardLoadResult: load must be 'maximum', 'unladen', or 'laden'`)}const fuel=this.#build.fuelCapacity;const cargo=load==="laden"?this.#build.cargoCapacity:0;const mass=load==="maximum"?this.#build.unladenMass:0;let drive=null;let maximumFuel=null;if(load==="maximum"){const fitted=this.#state.frameShiftDriveModule();let driveError=null;try{drive=this.#state.resolveDrive();maximumFuel=drive?.maxFuel??null}catch(error){if(!(error instanceof Error))throw error;driveError=error}if(maximumFuel===null){return incompleteResult([{field:"frameShiftDrive",reason:fitted?"unresolved":"missing",slot:fitted?.Slot??"FrameShiftDrive",...fitted?{symbol:fitted.Item}:{},message:driveError?.message??"FrameShiftDrive: no frame shift drive is fitted",params:fitted?{field:"frameShiftDrive",reason:"unresolved",slot:fitted.Slot,symbol:fitted.Item}:{field:"frameShiftDrive",reason:"missing",slot:"FrameShiftDrive"}}])}}const carriedFuel=load==="maximum"?Math.min(fuel.main,maximumFuel):fuel.main;const value=Object.freeze({fuel:carriedFuel,cargo:cargo,mass:this.#build.unladenMass+carriedFuel+cargo});if(load==="maximum"){try{this.jumpRange(value)}catch(error){if(!(error instanceof RangeError))throw error;const fitted=this.#state.frameShiftDriveModule();const field=drive!==null&&(!Number.isFinite(drive.maxFuel)||drive.maxFuel<0)?"frameShiftDrive":!Number.isFinite(value.fuel)||value.fuel<0?"fuelCapacity":!Number.isFinite(mass)||mass<0?"mass":"frameShiftDrive";const driveParams=field==="frameShiftDrive"&&fitted?{slot:fitted.Slot,symbol:fitted.Item}:{};return incompleteResult([{field:field,reason:"invalid",...driveParams,message:error.message,params:{field:field,reason:"invalid",...driveParams}}])}}return completeResult(value)}#require(result,what){if(result.value===null){throw new TypeError(`${FACADE}: cannot determine ${what} (${result.issues.map(issue=>issue.message).join("; ")})`)}return result.value}#loadedMass(cargo){return this.#build.unladenMass+cargo}#maxJumpFuel(fsd){return Math.min(this.#build.fuelCapacity.main,fsd.maxFuel)}};export{BuildMetrics};//# sourceMappingURL=chunk-3RTUSDQF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ships/build-metrics.ts"],"names":["cellBankSummary","shieldRecovery","loadoutInternals","fittedThrusterParamsFor","preEngineeredVariantFor","powerConsumerFor","powerAvailable","heatInputResultFor","completeResult","cellBankInputsFor","armourInputFor","weaponStatsFor","weaponsCapacitorInputFor","mobilityInputResultFor","shieldInputResultFor","shieldCapacitorInputResultFor","shieldRecoveryInputResultFor","distributorInputResultFor","incompleteResult","shieldMetrics","weaponsCapacitorMetrics","powerBudget","isNonOutfittingSlot","isBuiltInHullModule","orderBySlotLayout","weaponMetrics","sumWeaponMetrics","shieldCapacitorMetrics","mobilityCapacitorMetrics","mobilityMetrics","getExperimentalEffectCost","heatMetrics","frameShiftDriveMassFactor","singleJumpRange","fuelPerJump","totalRange","calculateUnladenMass","getBlueprintCost","distributorMetrics","sumMaterials","ammunitionCapacity","armourMetrics","requirePips","requireFiniteNonNegative","deepFreeze","FACADE","requireLoadOptions","scope","options","field","value","BuildMetrics","_BuildMetrics","build","state","constructor","this","of","loadout","frameShiftDrive","drive","resolveDrive","TypeError","thrusters","modules","statsFor","loadedMass","cargo","fuel","fuelCapacity","main","maxJumpRange","fsd","maxJumpFuel","jumpRange","ladenJumpRange","cargoCapacity","distance","standardLoadResult","load","standardLoad","jumpRangeSummary","maximum","require","unladen","laden","max","totalMax","totalUnladen","totalLaden","buildMass","unladenMass","Object","freeze","hull","ship","hullMass","calculationModules","total","buildCost","hullCost","mercCoins","unpriced","materials","module","stats","cost","Slot","push","slot","symbol","Item","variant","mercCoinCost","engineering","Engineering","grade","Level","bought","Number","isInteger","climb","BlueprintName","experimental","ExperimentalEffect","toLowerCase","experimentalEffectSymbol","credits","rebuy","Math","trunc","consumers","consumer","heatMetricsResult","input","effectiveModules","complete","mobilityMetricsResult","mobility","mobilityCapacitorMetricsResult","mobilityCapacitor","shieldMetricsResult","shields","shieldCapacitorMetricsResult","shieldCapacitor","shieldRecoveryResult","recovery","cellBanks","layout","bank","weapons","record","effectiveModule","name","enabled","On","metrics","ammunition","maximumRange","falloffRange","projectileRange","armourPiercing","orderedWeapons","weapon","filter","map","weaponsPips","distributorMetricsResult","distributor","mobilityInput","enginesPips","statedMainFuel","systemsPips","pips","RangeError","mass","maximumFuel","fitted","frameShiftDriveModule","driveError","maxFuel","error","Error","reason","message","params","carriedFuel","min","isFinite","driveParams","result","what","issues","issue","join"],"mappings":"O,o/CAkHA,IAAM6C,OAAS,eAuQf,SAASC,mBAAmBC,MAAeC,SACvC,IAAA,MAAWC,QAAS,CAAC,OAAQ,SAAmB,CAC5C,MAAMC,MAAQF,QAAQC,OACtB,GAAIC,aAAU,EAAWP,yBAAyBI,MAAOE,MAAOC,MACpE,CACJ,CAuBO,IAAMC,aAAN,MAAMC,cACAC,OACAC,OAED,WAAAC,CAAYF,MAAoBC,OACpCE,MAAKH,MAASA,MACdG,MAAKF,MAASA,KAClB,CAqBA,SAAOG,CAAGJ,OACN,OAAO,IAAID,cAAaC,MAAOnD,iBAAiBmD,MAAO,GAAGR,oBAC9D,CASA,OAAAa,GACI,OAAOF,MAAKH,KAChB,CAUA,eAAAM,GACI,MAAMC,MAAQJ,MAAKF,MAAOO,eAC1B,GAAID,QAAU,KAAM,CAChB,MAAM,IAAIE,UAAU,GAAGjB,yCAC3B,CACA,OAAOe,KACX,CAgCA,SAAAG,GACI,OAAO5D,wBAAwBqD,MAAKF,MAAOU,UAAWR,MAAKF,MAAOW,SACtE,CAyBA,yBAAAjC,CAA0BgB,QAAuB,CAAA,GAC7CF,mBAAmB,GAAGD,mCAAoCG,SAC1D,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CAAExI,YAAOsI,OAAQ,aAAcM,eAGnD,CACJ,CACA,OAAOrL,eAAe0C,MAC1B,CAGA,QAAAiC,CAAY2G,OAA8BC,MACtC,GAAID,OAAO5I,QAAU,KAAM,CACvB,MAAM,IAAIY,UACN,GAAGjB,4BAA4BkJ,SAASD,OAAOE,OAAO3B,IAAK4B,OAAUA,MAAMT,SAASU,KAAK,SAEjG,CACA,OAAOJ,OAAO5I,KAClB,CAGA,WAAAgB,CAAYC,OACR,OAAOX,MAAKH,MAAOsC,YAAcxB,KACrC,CAGA,YAAAM,CAAaD,KACT,OAAOyD,KAAK0D,IAAInI,MAAKH,MAAOgB,aAAaC,KAAME,IAAI4G,QACvD,UACJjI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{combinedRateOfFire}from"./chunk-37JIMWLK.js";import{builtInModuleBySymbol,getModuleBySymbol}from"./chunk-3LZXB2MC.js";import{getPreEngineeredVariants}from"./chunk-PL75RTA2.js";import{ALL_MODULES}from"./chunk-7ZERP4TB.js";import{EXPERIMENTAL_EFFECTS,getExperimentalEffect}from"./chunk-77I24V6B.js";import{resolveBlueprintForModule}from"./chunk-OLKNYGGT.js";import{getBlueprintGrade,getBlueprint,BLUEPRINTS}from"./chunk-AYAKU4YA.js";import{getBlueprintsForModule,getExperimentalsForModule,getEngineeringGroup}from"./chunk-GLWPSVFV.js";import{fieldForLabel,damageTypeForLabel,capabilityValueForLabel,baseStats,computeModifiers,labelsForDamageType,scaleForLabel,preciseModifierValue}from"./chunk-CJQ37JII.js";import{normalizeKey}from"./chunk-BKWLI44T.js";import{requireStringIfPresent}from"./chunk-PKWVG2JY.js";import{deepFreeze}from"./chunk-DURKO7JU.js";function scaleDamageComponents(components,baseDamage,effectiveDamage){const scale=baseDamage!==void 0&&baseDamage!==0&&effectiveDamage!==void 0?effectiveDamage/baseDamage:1;return{...components.kinetic===void 0?{}:{kinetic:components.kinetic*scale},...components.thermal===void 0?{}:{thermal:components.thermal*scale},...components.explosive===void 0?{}:{explosive:components.explosive*scale},...components.absolute===void 0?{}:{absolute:components.absolute*scale},...components.antiXeno===void 0?{}:{antiXeno:components.antiXeno*scale},...components.unclassified===void 0?{}:{unclassified:components.unclassified.map(value=>value*scale)}}}function fixedModifierFeatures(modifiers){return modifiers.map(modifier=>({label:modifier.label,method:modifier.method,min:modifier.value,max:modifier.value}))}var FITTED_ITEM="ShipLoadout: fitted module Item";function isNonOutfittingSlot(slotKey){return/^(paintjob|shipname\d+|shipid\d+|bobble\d+|decal\d+|shipkit.+|weaponcolour|enginecolour|vesselvoice|shipcockpit|stringlights)$/i.test(slotKey)}function isCargoHatchSlot(slotKey){return slotKey.toLowerCase()==="cargohatch"}function isBuiltInHullModule(module){return isCargoHatchSlot(module.Slot)&&module.Item.toLowerCase().startsWith("modularcargobaydoor")}function cloneLoadoutModule(module){return{Slot:module.Slot,Item:module.Item,...module.On===void 0?{}:{On:module.On},...module.Priority===void 0?{}:{Priority:module.Priority},...module.Health===void 0?{}:{Health:module.Health},...module.Value===void 0?{}:{Value:module.Value},...module.Engineering===void 0?{}:{Engineering:{BlueprintName:module.Engineering.BlueprintName,Level:module.Engineering.Level,Quality:module.Engineering.Quality,...module.Engineering.ExperimentalEffect===void 0?{}:{ExperimentalEffect:module.Engineering.ExperimentalEffect},...module.Engineering.ExperimentalEffect_Localised===void 0?{}:{ExperimentalEffect_Localised:module.Engineering.ExperimentalEffect_Localised},...module.Engineering.Modifiers===void 0?{}:{Modifiers:module.Engineering.Modifiers.map(modifier=>({...modifier}))}}}}}function matchingKeyIn(keyed,slotKey){if(keyed.has(slotKey))return slotKey;const wanted=slotKey.toLowerCase();for(const key of keyed.keys()){if(key.toLowerCase()===wanted)return key}return null}function ownKeyIn(keyed,canonicalKey){return matchingKeyIn(keyed,canonicalKey)??(keyed.size>0&&[...keyed.keys()].every(key=>key===key.toLowerCase())?canonicalKey.toLowerCase():canonicalKey)}function orderBySlotLayout(values,layout,slotOf){const order=new Map(layout.map((slot,index)=>[slot.key.toLowerCase(),index]));return[...values].sort((left,right)=>(order.get(slotOf(left).toLowerCase())??Number.MAX_SAFE_INTEGER)-(order.get(slotOf(right).toLowerCase())??Number.MAX_SAFE_INTEGER))}function cloneModuleStats(module){try{return deepFreeze(structuredClone(module))}catch(error){if(!(error instanceof Error&&error.name==="DataCloneError"))throw error;return deepFreeze({...module,...module.restrictedToShips===void 0?{}:{restrictedToShips:[...module.restrictedToShips]},...module.limitIncrease===void 0?{}:{limitIncrease:{...module.limitIncrease}},...module.damageDistribution===void 0?{}:{damageDistribution:{...module.damageDistribution}},...module.damageComponents===void 0?{}:{damageComponents:{...module.damageComponents,...module.damageComponents.unclassified===void 0?{}:{unclassified:[...module.damageComponents.unclassified]}}},...module.projectileRange===void 0?{}:{projectileRange:{...module.projectileRange}}})}}var GUARDIAN_WEAPON_GROUPS=/* @__PURE__ */new Set(["guardianGauss","guardianPlasma","guardianShard"]);function missingBaseLabels(stats,base,features,experimental){const contributions=[...features,...experimental??[]];return[...new Set(contributions.map(contribution=>contribution.label).filter(label=>{if(base[label]!==void 0)return false;return fieldForLabel(label,stats)===null}))]}function recipeSignature(blueprintSymbol){const blueprint=getBlueprint(blueprintSymbol);if(!blueprint)return null;const grades=Object.entries(blueprint.grades).map(([grade,{features:features}])=>`${grade}:${features.map(feature=>`${feature.label}/${feature.method??""}`).sort().join(",")}`).sort().join(";");return`${blueprint.name.toLowerCase()}|${grades}`}var isGenericSpelling=blueprintSymbol=>blueprintSymbol.toLowerCase().startsWith("misc_");function isSoldWithBlueprint(item,wanted){return getPreEngineeredVariants(item).some(variant=>variant.acquisition==="mercenary"&&variant.blueprintSymbol.toLowerCase()===wanted)}function blueprintRoutesFor(item){const routes=/* @__PURE__ */new Map;for(const blueprintSymbol of getBlueprintsForModule(item))routes.set(blueprintSymbol,"ordinary");for(const variant of getPreEngineeredVariants(item)){if(variant.acquisition==="mercenary"&&!routes.has(variant.blueprintSymbol)){routes.set(variant.blueprintSymbol,"mercenary")}}return routes}function blueprintAvailableFor(item,blueprintSymbol){const offered=getBlueprintsForModule(item);const asWritten=normalizeKey(blueprintSymbol,"ShipLoadout.applyBlueprint: blueprintSymbol");const resolved=resolveBlueprintForModule(item,blueprintSymbol).trim();const wanted=resolved.toLowerCase();if(offered.some(id=>id.toLowerCase()===wanted))return true;if(isSoldWithBlueprint(item,wanted)||isSoldWithBlueprint(item,asWritten))return true;if(!isGenericSpelling(wanted))return false;const signature=recipeSignature(resolved);if(signature===null)return false;return offered.some(id=>recipeSignature(id)===signature&&!isGenericSpelling(id))}function experimentalAvailableFor(item,experimentalEffectSymbol){const wanted=normalizeKey(experimentalEffectSymbol,"ShipLoadout.applyBlueprint: options.experimentalEffectSymbol");return getExperimentalsForModule(item).some(id=>id.toLowerCase()===wanted)}function primitiveLabelFor(stats,label){if(label==="MaximumRange"&&stats.maximumRange!==void 0)return"Range";if(label==="DamageFalloffRange"&&stats.falloffRange!==void 0){return"FalloffRange"}if(label==="Range"&&stats.scannerRange!==void 0)return"ScannerRange";if(label==="DSS_PatchRadius")return"ProbeRadius";if(label==="FuelScoopRate")return"RefuelRate";if(label==="EnergyPerRegen"&&stats.shieldRegenRate!==void 0){return"DistributorDraw"}return label}function primitiveEngineeringInputsFor(stats,grade,experimental){const canonicalGrade={...grade,features:grade.features.map(feature=>{const label=primitiveLabelFor(stats,feature.label);return label===feature.label?feature:{...feature,label:label}})};if(!experimental)return{grade:canonicalGrade};return{grade:canonicalGrade,experimental:{...experimental,modifiers:experimental.modifiers.map(modifier=>{const label=primitiveLabelFor(stats,modifier.label);return label===modifier.label?modifier:{...modifier,label:label}})}}}function matchesCalculatedModifiers(captured,calculated){if(!captured||captured.length!==calculated.length)return false;const byLabel=new Map(captured.map(modifier=>[modifier.Label.trim().toLowerCase(),modifier]));if(byLabel.size!==captured.length)return false;return calculated.every(expected=>{const actual=byLabel.get(expected.Label.trim().toLowerCase());if(!actual)return false;if(expected.Value!==void 0){return actual.Value!==void 0&&Math.abs(actual.Value-expected.Value)<=1e-5*Math.max(1,Math.abs(expected.Value))}return actual.ValueStr===expected.ValueStr})}function identityArticles(item,engineering){if(engineering.Modifiers!==void 0||typeof engineering.BlueprintName!=="string"){return[]}const wanted=engineering.BlueprintName.trim().toLowerCase();const experimental=engineering.ExperimentalEffect?.trim().toLowerCase();return getPreEngineeredVariants(item).filter(candidate=>candidate.blueprintSymbol.trim().toLowerCase()===wanted&&candidate.grade===engineering.Level&&(candidate.experimentalEffectSymbol===void 0?experimental===void 0&&engineering.ExperimentalEffect_Localised===void 0:candidate.experimentalEffectSymbol.trim().toLowerCase()===experimental))}function unrollableFixedArticle(item,engineering){const matches=identityArticles(item,engineering).filter(candidate=>!blueprintAvailableFor(item,candidate.blueprintSymbol));return matches.length===1?matches[0]:null}function rolledOverFixedArticle(item,engineering){const matches=identityArticles(item,engineering).filter(candidate=>blueprintAvailableFor(item,candidate.blueprintSymbol));return matches.length===1?matches[0]:null}function statesInertModifiers(stats,modifiers){return modifiers.every(modifier=>{if(damageTypeForLabel(modifier.Label)!==null||capabilityValueForLabel(modifier.Label)!==null){return false}const field=fieldForLabel(modifier.Label,stats);return field===null||typeof stats[field]!=="number"})}function ordinaryEngineeringProof(item,engineering,experimental){const recipe=resolveBlueprintForModule(item,engineering.BlueprintName);const fixedCandidate=getPreEngineeredVariants(item).some(candidate=>candidate.acquisition!=="mercenary"&&candidate.blueprintSymbol.trim().toLowerCase()===recipe.trim().toLowerCase());if(!fixedCandidate)return"notFixedCandidate";const grade=getBlueprintGrade(recipe,engineering.Level);const quality=engineering.Quality;const stock=builtInModuleBySymbol(item,FITTED_ITEM);if(!stock||!grade||experimental===null||!Number.isFinite(quality)||quality<0||quality>1){return"unproven"}const current=primitiveEngineeringInputsFor(stock,grade,experimental);if(missingBaseLabels(stock,baseStats(stock),current.grade.features,current.experimental?.modifiers).length>0){return"unproven"}const calculated=journalModifiersFor(stock,computeModifiers(baseStats(stock),current.grade,quality,current.experimental));const damageDistribution=current.experimental?.damageDistribution??current.grade.damageDistribution;if(damageDistribution){for(const type of["kinetic","thermal","explosive","absolute"]){const value=damageDistribution[type];if(value===void 0)continue;const label=labelsForDamageType(type)[0];if(label===void 0)continue;calculated.push({Label:label,Value:value*scaleForLabel(label),OriginalValue:(stock.damageDistribution?.[type]??0)*scaleForLabel(label)})}}return matchesCalculatedModifiers(engineering.Modifiers,calculated)?"proven":"unproven"}var round6=value=>{const rounded=Math.round(value*1e6)/1e6;return Object.is(rounded,-0)?0:rounded};function float32FiringCycle(interval,burstRounds,burstRateOfFire){if(interval<=0)return void 0;const withinBurst=burstRounds>1?Math.fround(Math.fround(burstRounds-1)/Math.fround(burstRateOfFire)):0;const cycle=Math.fround(withinBurst+Math.fround(interval));return cycle>0?cycle:void 0}function float32RateOfFire(interval,burstRounds,burstRateOfFire){const cycle=float32FiringCycle(interval,burstRounds,burstRateOfFire);return cycle===void 0?void 0:Math.fround(Math.fround(burstRounds)/cycle)}function float32DamagePerSecond(damage,rounds,rate,burstRounds,cycle){if(cycle!==void 0&&(rounds!==1||burstRounds!==1)){const damagePerCycle=Math.fround(Math.fround(Math.fround(damage)*Math.fround(rounds))*Math.fround(burstRounds));return Math.fround(damagePerCycle/cycle)}return Math.fround(Math.fround(Math.fround(damage)*Math.fround(rounds))*Math.fround(rate))}var JOURNAL_MODIFIER_ORDER=["CargoCapacity","GuardianModuleResistance","Mass","Integrity","PowerDraw","BootTime","PowerCapacity","HeatEfficiency","FSDOptimalMass","MaxFuelPerJump","FSDHeatRate","EngineOptimalMass","EngineOptPerformance","EngineHeatRate","ShieldGenOptimalMass","ShieldGenStrength","DamagePerSecond","Damage","DistributorDraw","ThermalLoad","ArmourPenetration","MaximumRange","ShotSpeed","RateOfFire","DamageType","$Kinetic;","$Thermal;","$Explosive;","$Absolute;","AmmoClipSize","AmmoMaximum","ReloadTime","Jitter","DamageFalloffRange","DefenceModifierShieldMultiplier","DefenceModifierHealthMultiplier","DefenceModifierHealthAddition","DefenceModifierShieldAddition","RegenRate","BrokenRegenRate","EnergyPerRegen","KineticResistance","ThermicResistance","ExplosiveResistance","CausticResistance","DamageProtection","ModuleDefenceAbsorption","WeaponsCapacity","WeaponsRecharge","EnginesCapacity","EnginesRecharge","SystemsCapacity","SystemsRecharge","ShieldBankSpinUp","ShieldBankDuration","ShieldBankReinforcement","ShieldBankHeat","FSDInterdictorRange","FSDInterdictorFacingLimit","SensorTargetScanAngle","MaxAngle","ScannerTimeToScan","Range","DSS_PatchRadius","FuelScoopRate","FuelCapacity"];var JOURNAL_MODIFIER_RANK=new Map(JOURNAL_MODIFIER_ORDER.map((label,index)=>[label,index]));function sortJournalModifiers(modifiers){return modifiers.map((modifier,index)=>({modifier:modifier,index:index})).sort((a,b)=>(JOURNAL_MODIFIER_RANK.get(a.modifier.Label)??JOURNAL_MODIFIER_ORDER.length)-(JOURNAL_MODIFIER_RANK.get(b.modifier.Label)??JOURNAL_MODIFIER_ORDER.length)||a.index-b.index).map(({modifier:modifier})=>modifier)}function journalModifiersFor(stats,modifiers){const weapon=stats.damage!==void 0;const valueFor=(label,fallback)=>{const modifier=modifiers.find(candidate=>candidate.Label===label);return(modifier&&preciseModifierValue(modifier))??Math.fround(fallback)};const burstTouched=["BurstInterval","BurstSize","BurstRateOfFire"].some(label=>modifiers.some(modifier=>modifier.Label===label));const damageTouched=modifiers.some(modifier=>modifier.Label==="Damage");const rateTouched=burstTouched||modifiers.some(modifier=>modifier.Label==="RateOfFire");let damagePerSecond;let derivedRate;if(weapon&&(damageTouched||rateTouched)){const continuous=stats.burstInterval===void 0&&stats.rateOfFire===void 0;const baseDamage=Math.fround(stats.damage);const effectiveDamage=valueFor("Damage",stats.damage);if(continuous){damagePerSecond={Label:"DamagePerSecond",Value:round6(effectiveDamage),OriginalValue:round6(baseDamage)}}else{const burstRounds=valueFor("BurstSize",stats.burstRounds??1);const burstRate=valueFor("BurstRateOfFire",stats.burstRateOfFire??1);const baseBurstRounds=Math.fround(stats.burstRounds??1);const baseBurstRate=Math.fround(stats.burstRateOfFire??1);const baseInterval=stats.burstInterval===void 0?void 0:Math.fround(stats.burstInterval);const baseCycle=baseInterval===void 0?void 0:float32FiringCycle(baseInterval,baseBurstRounds,baseBurstRate);const baseRate=baseInterval!==void 0?float32RateOfFire(baseInterval,baseBurstRounds,baseBurstRate):stats.rateOfFire===void 0?void 0:Math.fround(stats.rateOfFire);const rateModifier=modifiers.find(modifier=>modifier.Label==="RateOfFire");const effectiveRate=rateModifier&&preciseModifierValue(rateModifier);const effectiveInterval=valueFor("BurstInterval",stats.burstInterval??0);const effectiveCycle=effectiveRate===void 0?float32FiringCycle(effectiveInterval,burstRounds,burstRate):void 0;const rate=effectiveRate??(effectiveCycle===void 0?void 0:Math.fround(Math.fround(burstRounds)/effectiveCycle));if(baseRate!==void 0&&rate!==void 0){const stockRounds=Math.fround(stats.roundsPerShot??1);const effectiveRounds=Math.fround(modifiers.find(modifier=>modifier.Label==="Rounds"||modifier.Label==="RoundsPerShot")?.Value??stockRounds);damagePerSecond={Label:"DamagePerSecond",Value:round6(float32DamagePerSecond(effectiveDamage,effectiveRounds,rate,burstRounds,effectiveCycle)),OriginalValue:round6(float32DamagePerSecond(baseDamage,stockRounds,baseRate,baseBurstRounds,baseCycle))};if(burstTouched){derivedRate={Label:"RateOfFire",Value:round6(rate),OriginalValue:round6(baseRate)}}}}}const result=[];for(const modifier of modifiers){const label=modifier.Label;if(weapon&&["BurstInterval","BurstSize","BurstRateOfFire"].includes(label))continue;if(weapon&&label==="Damage"&&stats.rateOfFire===void 0)continue;let journalLabel=label;if(label==="Range"&&stats.maximumRange!==void 0)journalLabel="MaximumRange";else if(label==="FalloffRange"&&stats.falloffRange!==void 0){journalLabel="DamageFalloffRange"}else if(label==="ScannerRange"&&stats.scannerRange!==void 0){journalLabel="Range"}else if(label==="ProbeRadius")journalLabel="DSS_PatchRadius";else if(label==="RefuelRate")journalLabel="FuelScoopRate";else if(label==="DistributorDraw"&&stats.shieldRegenRate!==void 0){journalLabel="EnergyPerRegen"}result.push(journalLabel===label?modifier:{...modifier,Label:journalLabel})}if(damagePerSecond)result.push(damagePerSecond);if(derivedRate){const direct=result.findIndex(modifier=>modifier.Label==="RateOfFire");if(direct>=0)result[direct]=derivedRate;else result.push(derivedRate)}return sortJournalModifiers(result)}function isFinalGuardianWeaponEngineering(item,blueprint){const group=getEngineeringGroup(item);if(group===null||!GUARDIAN_WEAPON_GROUPS.has(group))return false;const resolved=resolveBlueprintForModule(item,blueprint);return getBlueprint(resolved)!==null&&!blueprintAvailableFor(item,blueprint)}function engineerableBase(item,statsOverride){const stats=statsOverride??builtInModuleBySymbol(item,FITTED_ITEM);if(!stats||stats.engineeringLocked)return null;return{stats:stats,base:baseStats(stats)}}function availableBlueprintsFor(item,statsOverride){const engineerable=engineerableBase(item,statsOverride);if(!engineerable)return[];const{stats:stats,base:base}=engineerable;const available=[];for(const[blueprintSymbol,route]of blueprintRoutesFor(item)){const blueprint=BLUEPRINTS[blueprintSymbol];if(!blueprint)continue;const grades=Object.entries(blueprint.grades).filter(([,grade])=>missingBaseLabels(stats,base,grade.features).length===0).map(([grade])=>Number(grade)).filter(Number.isFinite).sort((a,b)=>a-b);if(grades.length>0)available.push({blueprintSymbol:blueprintSymbol,grades:grades,route:route})}return available}function availableExperimentalsFor(item,statsOverride){const engineerable=engineerableBase(item,statsOverride);if(!engineerable)return[];const{stats:stats,base:base}=engineerable;return getExperimentalsForModule(item).filter(experimentalEffectSymbol=>{const effect=EXPERIMENTAL_EFFECTS[experimentalEffectSymbol];return effect!==void 0&&missingBaseLabels(stats,base,effect.modifiers).length===0})}var MAX_ENGINEERING_GRADE=5;function modifiersWithExperimental(variant,experimental){const module=getModuleBySymbol(variant.symbol,ALL_MODULES);const effectName=experimental===void 0?variant.experimentalEffectSymbol:experimental;if(!module||!variant.modifiers?.length&&effectName==null)return null;const effect=effectName==null?void 0:getExperimentalEffect(effectName);if(effectName!==null&&effectName!==void 0&&!effect)return null;return computeModifiers(baseStats(module),fixedModifierFeatures(variant.modifiers??[]),1,effect??void 0)}function getPreEngineeredModifiers(variant){return modifiersWithExperimental(variant)??[]}function journalModifiersWithExperimental(variant,experimental){const module=getModuleBySymbol(variant.symbol,ALL_MODULES);if(!module)return[];const modifiers=journalModifiersFor(module,modifiersWithExperimental(variant,experimental)??[]);const effectName=experimental===void 0?variant.experimentalEffectSymbol:experimental;const damageDistribution=effectName?getExperimentalEffect(effectName)?.damageDistribution:void 0;if(!damageDistribution)return modifiers;for(const type of["kinetic","thermal","explosive","absolute"]){const value=damageDistribution[type];const label=labelsForDamageType(type)[0];if(value===void 0||label===void 0)continue;modifiers.push({Label:label,Value:value*scaleForLabel(label),OriginalValue:(module.damageDistribution?.[type]??0)*scaleForLabel(label)})}return modifiers}function getPreEngineeredJournalModifiers(variant){return journalModifiersWithExperimental(variant)}function sameJournalNumber(actual,expected,base){return Math.abs(actual-expected)<=Math.max(1e-5,Math.abs(base)*1e-4,Math.abs(expected)*1e-6)}function modifierKey(modifier,module){return fieldForLabel(modifier.Label,module)??`label:${normalizeKey(modifier.Label,"identifyPreEngineeredVariant: module.Engineering.Modifiers[].Label")}`}function sameModifier(actual,expected){if(expected.Value!==void 0){return actual.Value!==void 0&&sameJournalNumber(actual.Value,expected.Value,expected.OriginalValue??expected.Value)}return expected.ValueStr!==void 0&&actual.ValueStr!==void 0}function matchesModifierSignature(actualByKey,expected,module){let matched=0;for(const predicted of expected){const actual=actualByKey.get(modifierKey(predicted,module));if(!actual)continue;if(!sameModifier(actual,predicted))return false;matched++}return matched>=Math.max(1,expected.length-1)}function identifyPreEngineeredVariant(module){const engineering=module.Engineering;if(!engineering)return null;requireStringIfPresent(module.Item,"identifyPreEngineeredVariant: module.Item");const stock=getModuleBySymbol(module.Item,ALL_MODULES);if(!stock)return null;const capturedBlueprint=normalizeKey(engineering.BlueprintName,"identifyPreEngineeredVariant: module.Engineering.BlueprintName");const variants=getPreEngineeredVariants(module.Item);const blueprintMatches=variants.filter(candidate=>candidate.blueprintSymbol.toLowerCase()===capturedBlueprint);const blueprintMatch=blueprintMatches.length===1?blueprintMatches[0]:null;const capturedGrade=engineering.Level;if(blueprintMatch?.acquisition==="mercenary"&&Number.isInteger(capturedGrade)&&capturedGrade>=blueprintMatch.grade&&capturedGrade<=MAX_ENGINEERING_GRADE){return blueprintMatch}if(engineering.Modifiers===void 0){const capturedExperimental=normalizeKey(engineering.ExperimentalEffect,"identifyPreEngineeredVariant: module.Engineering.ExperimentalEffect");const identityMatches=blueprintMatches.filter(candidate=>candidate.engineeringLocked===true&&candidate.grade===capturedGrade&&(candidate.experimentalEffectSymbol===void 0?capturedExperimental===void 0&&engineering.ExperimentalEffect_Localised===void 0:candidate.experimentalEffectSymbol.toLowerCase()===capturedExperimental));return identityMatches.length===1?identityMatches[0]:null}if(!engineering.Modifiers?.length)return null;const actualByKey=/* @__PURE__ */new Map;for(const modifier of engineering.Modifiers){actualByKey.set(modifierKey(modifier,stock),modifier)}requireStringIfPresent(engineering.ExperimentalEffect,"identifyPreEngineeredVariant: module.Engineering.ExperimentalEffect");const matches=[];for(const candidate of variants){if(!candidate.modifiers?.length)continue;if(candidate.grade!==engineering.Level)continue;if(candidate.acquisition==="eventReward"&&(engineering.ExperimentalEffect!==void 0||engineering.ExperimentalEffect_Localised!==void 0||capturedBlueprint!==candidate.blueprintSymbol.toLowerCase())){continue}const primitive=modifiersWithExperimental(candidate,engineering.ExperimentalEffect??null);if(!primitive?.length)continue;const matched=matchesModifierSignature(actualByKey,primitive,stock)||matchesModifierSignature(actualByKey,journalModifiersWithExperimental(candidate,engineering.ExperimentalEffect??null),stock);if(matched)matches.push(candidate)}return matches.length===1?matches[0]:null}function unresolvedModifiers(variant){const resolved=new Set(getPreEngineeredModifiers(variant).map(modifier=>modifier.Label));return(variant.modifiers??[]).map(modifier=>modifier.label).filter(label=>!resolved.has(label))}function getPreEngineeredStats(variant){const module=getModuleBySymbol(variant.symbol,ALL_MODULES);if(!module)return null;if(!variant.modifiers?.length&&!variant.engineeringLocked&&variant.experimentalEffectSymbol===void 0)return{...module};const modifiers=variant.modifiers??[];const resolved={...module,...variant.engineeringLocked?{engineeringLocked:true}:{}};for(const{Label:Label,Value:Value,ValueStr:ValueStr}of getPreEngineeredModifiers(variant)){const field=fieldForLabel(Label,module);if(field&&field!=="damageDistribution"&&Value!==void 0){Object.assign(resolved,{[field]:Value/scaleForLabel(Label)})}else if(field&&ValueStr!==void 0&&capabilityValueForLabel(Label)!==null){Object.assign(resolved,{[field]:true})}}const experimentalDamageDistribution=variant.experimentalEffectSymbol?getExperimentalEffect(variant.experimentalEffectSymbol)?.damageDistribution:void 0;if(experimentalDamageDistribution){resolved.damageDistribution={...experimentalDamageDistribution};delete resolved.damageComponents}if(resolved.rateOfFire!==void 0&&!modifiers.some(m=>m.label==="RateOfFire")&&modifiers.some(m=>m.label==="BurstSize"||m.label==="BurstRateOfFire"||m.label==="BurstInterval")){const rate=combinedRateOfFire(resolved);if(rate!==void 0)resolved.rateOfFire=rate}if(module.damageComponents&&!experimentalDamageDistribution){resolved.damageComponents=scaleDamageComponents(module.damageComponents,module.damage,resolved.damage)}return resolved}export{FITTED_ITEM,availableBlueprintsFor,availableExperimentalsFor,blueprintAvailableFor,blueprintRoutesFor,cloneLoadoutModule,cloneModuleStats,experimentalAvailableFor,getPreEngineeredJournalModifiers,getPreEngineeredModifiers,getPreEngineeredStats,identifyPreEngineeredVariant,isBuiltInHullModule,isCargoHatchSlot,isFinalGuardianWeaponEngineering,isNonOutfittingSlot,journalModifiersFor,matchingKeyIn,missingBaseLabels,orderBySlotLayout,ordinaryEngineeringProof,ownKeyIn,primitiveEngineeringInputsFor,rolledOverFixedArticle,scaleDamageComponents,statesInertModifiers,unresolvedModifiers,unrollableFixedArticle};//# sourceMappingURL=chunk-4OTQBHQL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ships/internal/damage-components.ts","../src/ships/internal/fixed-modifier-features.ts","../src/ships/internal/loadout-state.ts","../src/ships/internal/loadout-engineering.ts","../src/ships/pre-engineered-stats.ts"],"names":["combinedRateOfFire","builtInModuleBySymbol","getModuleBySymbol","getPreEngineeredVariants","ALL_MODULES","EXPERIMENTAL_EFFECTS","getExperimentalEffect","resolveBlueprintForModule","getBlueprintGrade","getBlueprint","BLUEPRINTS","getBlueprintsForModule","getExperimentalsForModule","getEngineeringGroup","fieldForLabel","damageTypeForLabel","capabilityValueForLabel","baseStats","computeModifiers","labelsForDamageType","scaleForLabel","preciseModifierValue","normalizeKey","requireStringIfPresent","deepFreeze","scaleDamageComponents","components","baseDamage","effectiveDamage","scale","kinetic","thermal","explosive","absolute","antiXeno","unclassified","map","value","fixedModifierFeatures","modifiers","modifier","label","method","min","max","FITTED_ITEM","isNonOutfittingSlot","slotKey","test","isCargoHatchSlot","toLowerCase","isBuiltInHullModule","module","Slot","Item","startsWith","cloneLoadoutModule","On","Priority","Health","Value","Engineering","BlueprintName","Level","Quality","ExperimentalEffect","ExperimentalEffect_Localised","Modifiers","matchingKeyIn","keyed","has","wanted","key","keys","ownKeyIn","canonicalKey","size","every","orderBySlotLayout","values","layout","slotOf","order","Map","slot","index","sort","left","right","get","Number","MAX_SAFE_INTEGER","cloneModuleStats","structuredClone","error","Error","name","restrictedToShips","limitIncrease","damageDistribution","damageComponents","projectileRange","GUARDIAN_WEAPON_GROUPS","Set","missingBaseLabels","stats","base","features","experimental","contributions","contribution","filter","recipeSignature","blueprintSymbol","blueprint","grades","Object","entries","grade","feature","join","isGenericSpelling","isSoldWithBlueprint","item","some","variant","acquisition","blueprintRoutesFor","routes","set","blueprintAvailableFor","offered","asWritten","resolved","trim","id","signature","experimentalAvailableFor","experimentalEffectSymbol","primitiveLabelFor","maximumRange","falloffRange","scannerRange","shieldRegenRate","primitiveEngineeringInputsFor","canonicalGrade","matchesCalculatedModifiers","captured","calculated","length","byLabel","Label","expected","actual","Math","abs","ValueStr","identityArticles","engineering","candidate","unrollableFixedArticle","matches","rolledOverFixedArticle","statesInertModifiers","field","ordinaryEngineeringProof","recipe","fixedCandidate","quality","stock","isFinite","current","journalModifiersFor","type","push","OriginalValue","round6","rounded","round","is","float32FiringCycle","interval","burstRounds","burstRateOfFire","withinBurst","fround","cycle","float32RateOfFire","float32DamagePerSecond","damage","rounds","rate","damagePerCycle","JOURNAL_MODIFIER_ORDER","JOURNAL_MODIFIER_RANK","sortJournalModifiers","a","b","weapon","valueFor","fallback","find","burstTouched","damageTouched","rateTouched","damagePerSecond","derivedRate","continuous","burstInterval","rateOfFire","burstRate","baseBurstRounds","baseBurstRate","baseInterval","baseCycle","baseRate","rateModifier","effectiveRate","effectiveInterval","effectiveCycle","stockRounds","roundsPerShot","effectiveRounds","result","includes","journalLabel","direct","findIndex","isFinalGuardianWeaponEngineering","group","engineerableBase","statsOverride","engineeringLocked","availableBlueprintsFor","engineerable","available","route","availableExperimentalsFor","effect","MAX_ENGINEERING_GRADE","modifiersWithExperimental","symbol","effectName","getPreEngineeredModifiers","journalModifiersWithExperimental","getPreEngineeredJournalModifiers","sameJournalNumber","modifierKey","sameModifier","matchesModifierSignature","actualByKey","matched","predicted","identifyPreEngineeredVariant","capturedBlueprint","variants","blueprintMatches","blueprintMatch","capturedGrade","isInteger","capturedExperimental","identityMatches","primitive","unresolvedModifiers","getPreEngineeredStats","assign","experimentalDamageDistribution","m"],"mappings":"O,m1BAWO,SAASyB,sBACZC,WACAC,WACAC,iBAEA,MAAMC,MACFF,kBAAe,GAAaA,aAAe,GAAKC,uBAAoB,EAC9DA,gBAAkBD,WAClB,EACV,MAAO,IACCD,WAAWI,eAAY,EAAY,CAAA,EAAK,CAAEA,QAASJ,WAAWI,QAAUD,UACxEH,WAAWK,eAAY,EAAY,CAAA,EAAK,CAAEA,QAASL,WAAWK,QAAUF,UACxEH,WAAWM,iBAAc,EAAY,CAAA,EAAK,CAAEA,UAAWN,WAAWM,UAAYH,UAC9EH,WAAWO,gBAAa,EAAY,CAAA,EAAK,CAAEA,SAAUP,WAAWO,SAAWJ,UAC3EH,WAAWQ,gBAAa,EA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,SAAU,CAAE+B,CAACA,OAAQxG,MAAQxC,cAAcmI,QAC7D,MAAA,GAAWa,OAASR,gBAAa,GAAa5I,wBAAwBuI,SAAW,KAAM,CACnFnC,OAAOqJ,OAAOpI,SAAU,CAAE+B,CAACA,OAAQ,MACvC,CACJ,CACA,MAAMsG,+BAAiC7I,QAAQa,yBACzCpI,sBAAsBuH,QAAQa,2BAA2BvC,wBACzD,EACN,GAAIuK,+BAAgC,CAChCrI,SAASlC,mBAAqB,IAAKuK,uCAC5BrI,SAASjC,gBACpB,CAGA,GACIiC,SAAS4E,kBAAe,IACvB1K,UAAUqF,KAAM+I,GAAMA,EAAElO,QAAU,eACnCF,UAAUqF,KACL+I,GACGA,EAAElO,QAAU,aACZkO,EAAElO,QAAU,mBACZkO,EAAElO,QAAU,iBAEtB,CACE,MAAMsJ,KAAO/L,mBAAmBqI,UAChC,GAAI0D,YAAS,EAAW1D,SAAS4E,WAAalB,IAClD,CACA,GAAI3I,OAAOgD,mBAAqBsK,+BAAgC,CAC5DrI,SAASjC,iBAAmB3E,sBACxB2B,OAAOgD,iBACPhD,OAAOyI,OACPxD,SAASwD,OAEjB,CACA,OAAOxD,QACX,QAAAxF,YAAA4L,uBAAAI,0BAAA3G,sBAAAH,mBAAAvE,mBAAAoC,iBAAA6C,yBAAA4G,iCAAAF,0BAAAqB,sBAAAX,6BAAA1M,oBAAAF,iBAAAmL,iCAAAtL,oBAAA8H,oBAAAxG,cAAAoC,kBAAA1B,kBAAAuF,yBAAA3F,SAAAsE,8BAAAkB,uBAAAzI,sBAAA0I,qBAAAoG,oBAAAvG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ALL_MICRO_RESOURCES}from"./chunk-
|
|
1
|
+
import{ALL_MICRO_RESOURCES}from"./chunk-DAQ3PJ4R.js";import{findInKeyIndex,findByKey,filterByKey,createKeyIndex}from"./chunk-BKWLI44T.js";var MICRO_RESOURCES_BY_SYMBOL=/* @__PURE__ */createKeyIndex(ALL_MICRO_RESOURCES,"symbol");var MICRO_RESOURCES_BY_NAME=/* @__PURE__ */createKeyIndex(ALL_MICRO_RESOURCES,"name");function getMicroResourceBySymbol(symbol,microResources=ALL_MICRO_RESOURCES){return microResources===ALL_MICRO_RESOURCES?findInKeyIndex(MICRO_RESOURCES_BY_SYMBOL,symbol,"getMicroResourceBySymbol: symbol"):findByKey(microResources,"symbol",symbol,"getMicroResourceBySymbol: symbol")}function getMicroResourceByName(name,microResources=ALL_MICRO_RESOURCES){return microResources===ALL_MICRO_RESOURCES?findInKeyIndex(MICRO_RESOURCES_BY_NAME,name,"getMicroResourceByName: name"):findByKey(microResources,"name",name,"getMicroResourceByName: name")}function microResourcesInCategory(category){return filterByKey(ALL_MICRO_RESOURCES,"category",category,"microResourcesInCategory: category")}export{getMicroResourceByName,getMicroResourceBySymbol,microResourcesInCategory};//# sourceMappingURL=chunk-7EWZGDWY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseSystemName,boxelCodeToLetters,formatSystemName}from"./chunk-7ATBEOVC.js";import{
|
|
1
|
+
import{parseSystemName,boxelCodeToLetters,formatSystemName}from"./chunk-7ATBEOVC.js";import{getHandAuthoredRegionOrigin,resolveNamingRegionOrigin}from"./chunk-DWRNXUAX.js";import{isPermitLockedRegionName}from"./chunk-NLBUKXNV.js";import{sizeClassToMassCode}from"./chunk-POZTXBSN.js";import{encodeSystemAddress,decodeSystemAddress,decodeModSystemAddress,encodeModSystemAddress,absoluteBoxelToBoxelCode}from"./chunk-DI5RXSJR.js";import{toSystemAddress}from"./chunk-NEEFT7WH.js";import{sectorGridPositionFromName,sectorNameFromGridPosition}from"./chunk-H47K3UWG.js";import{requireString,truncate}from"./chunk-PKWVG2JY.js";import{findHandAuthoredRegionAt}from"./chunk-AVZI6VKA.js";function tryEncodeModAddress(parts){const origin=resolveNamingRegionOrigin(parts.regionName);if(!origin)return null;try{return encodeModSystemAddress(parts,origin)}catch(error){if(error instanceof RangeError)return null;throw error}}function applyHaOverride(parts,decoded,position){if(!position)return{parts:parts,handAuthored:false,requiresPermit:false};const region=findHandAuthoredRegionAt(position);if(!region)return{parts:parts,handAuthored:false,requiresPermit:false};const origin=resolveNamingRegionOrigin(region.name);if(!origin||origin.x0<0||origin.y0<0||origin.z0<0){return{parts:parts,handAuthored:false,requiresPermit:false}}const boxelCode=absoluteBoxelToBoxelCode(decoded.sizeClass,decoded.absoluteBoxel,origin);if(boxelCode===null)return{parts:parts,handAuthored:false,requiresPermit:false};const{l1:l1,l2:l2,l3:l3,n1:n1}=boxelCodeToLetters(boxelCode);return{parts:{...parts,regionName:region.name,l1:l1,l2:l2,l3:l3,n1:n1},handAuthored:true,requiresPermit:isPermitLockedRegionName(region.name)}}var ProceduralSystem=class _ProceduralSystem{#parts;#position;#id64;#modId64;usesHandAuthoredRegion;requiresRegionPermit;constructor(parts,opts){this.#parts={...parts};this.#position=opts.position?{...opts.position}:void 0;this.#id64=opts.id64;this.#modId64=opts.modId64;this.usesHandAuthoredRegion=opts.handAuthored;this.requiresRegionPermit=opts.requiresPermit}static fromName(name){const parts=parseSystemName(requireString(name,"ProceduralSystem.fromName: name"));if(!parts)return null;const sectorPosition=sectorGridPositionFromName(parts.regionName);const namedOrigin=sectorPosition?null:getHandAuthoredRegionOrigin(parts.regionName);const named=namedOrigin!==null;const regionName=sectorPosition?sectorNameFromGridPosition(sectorPosition):namedOrigin?.name??parts.regionName;const canonicalParts={...parts,regionName:regionName};const origin=resolveNamingRegionOrigin(regionName);if(!origin)throw new RangeError(`Unknown sector: ${truncate(regionName)}`);return new _ProceduralSystem(canonicalParts,{id64:encodeSystemAddress(canonicalParts,origin),modId64:tryEncodeModAddress(canonicalParts),handAuthored:named,requiresPermit:named&&isPermitLockedRegionName(regionName)})}static fromSystemAddress(id64,position){const address=toSystemAddress(id64);return _ProceduralSystem.#fromDecoded(decodeSystemAddress(address),address,position)}static fromModSystemAddress(id64,position){const address=toSystemAddress(id64);return _ProceduralSystem.#fromDecoded(decodeModSystemAddress(address),void 0,position,address)}static#fromDecoded(decoded,id64,position,modId64){const{l1:l1,l2:l2,l3:l3,n1:n1}=boxelCodeToLetters(decoded.boxelCode);const base={regionName:sectorNameFromGridPosition(decoded.sectorGridPosition),l1:l1,l2:l2,l3:l3,massCode:decoded.sizeClass,n1:n1,n2:decoded.sequence};const overridden=applyHaOverride(base,decoded,position);const origin=resolveNamingRegionOrigin(overridden.parts.regionName);if(!origin){throw new RangeError(`Unknown sector: ${truncate(overridden.parts.regionName)}`)}const normalAddress=id64??encodeSystemAddress(overridden.parts,origin);const opts={id64:normalAddress,modId64:modId64??tryEncodeModAddress(overridden.parts),handAuthored:overridden.handAuthored,requiresPermit:overridden.requiresPermit,...position?{position:position}:{}};return new _ProceduralSystem(overridden.parts,opts)}get name(){return formatSystemName(this.#parts)}get namingRegionName(){return this.#parts.regionName}get massCode(){return sizeClassToMassCode(this.#parts.massCode)}get sequence(){return this.#parts.n2}get position(){return this.#position?{...this.#position}:null}get parts(){return{...this.#parts}}get systemAddress(){return this.#id64}get modSystemAddress(){return this.#modId64}};export{ProceduralSystem};//# sourceMappingURL=chunk-7TVFV3VO.js.map
|