@elite-dangerous-almanac/core 0.1.8 → 0.2.0

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.
Files changed (261) hide show
  1. package/PROVENANCE/i18n/SOURCES.md +2 -2
  2. package/PROVENANCE/ships/SOURCES.md +11 -9
  3. package/README.md +54 -40
  4. package/dist/astro/galaxy-grid.js +1 -1
  5. package/dist/astro/index.d.ts +1 -1
  6. package/dist/astro/index.js +1 -1
  7. package/dist/astro/naming-region-origins.d.ts +1 -1
  8. package/dist/astro/naming-region-origins.js +1 -1
  9. package/dist/astro/nebulae.d.ts +2 -2
  10. package/dist/astro/permit-locks.d.ts +2 -1
  11. package/dist/astro/permit-locks.js +1 -1
  12. package/dist/astro/procedural-system.d.ts +2 -1
  13. package/dist/astro/procedural-system.js +1 -1
  14. package/dist/astro/sector-name.d.ts +2 -1
  15. package/dist/astro/sector-name.js +1 -1
  16. package/dist/astro/system-address.d.ts +1 -1
  17. package/dist/astro/system-name.d.ts +14 -9
  18. package/dist/astro/system-name.js +1 -1
  19. package/dist/chunk-2W5MW376.js +1 -0
  20. package/dist/chunk-2W5MW376.js.map +1 -0
  21. package/dist/{chunk-VZZUNSDF.js → chunk-4KJ7CR74.js} +1 -1
  22. package/dist/{chunk-VZZUNSDF.js.map → chunk-4KJ7CR74.js.map} +1 -1
  23. package/dist/{chunk-6EUVIZAS.js → chunk-4QYTVSNR.js} +1 -1
  24. package/dist/{chunk-EKQCVCMK.js → chunk-5ZVYRX6Z.js} +1 -1
  25. package/dist/{chunk-EKQCVCMK.js.map → chunk-5ZVYRX6Z.js.map} +1 -1
  26. package/dist/chunk-6GJHUWMO.js +1 -0
  27. package/dist/chunk-6GJHUWMO.js.map +1 -0
  28. package/dist/chunk-6L56LWTT.js +1 -0
  29. package/dist/chunk-6L56LWTT.js.map +1 -0
  30. package/dist/{chunk-GQ5GX5TB.js → chunk-6O4NRRSB.js} +1 -1
  31. package/dist/chunk-6O4NRRSB.js.map +1 -0
  32. package/dist/{chunk-WNGQ3IAM.js → chunk-6UNAD74Z.js} +1 -1
  33. package/dist/{chunk-WNGQ3IAM.js.map → chunk-6UNAD74Z.js.map} +1 -1
  34. package/dist/{chunk-JPBMRJFC.js → chunk-77I24V6B.js} +1 -1
  35. package/dist/chunk-77I24V6B.js.map +1 -0
  36. package/dist/chunk-7ATBEOVC.js +1 -0
  37. package/dist/chunk-7ATBEOVC.js.map +1 -0
  38. package/dist/chunk-7TQ2X6Q3.js +1 -0
  39. package/dist/chunk-7TQ2X6Q3.js.map +1 -0
  40. package/dist/{chunk-6EPYVBAX.js → chunk-A6OINYNP.js} +1 -1
  41. package/dist/{chunk-Q3QCLNVG.js → chunk-AYAKU4YA.js} +1 -1
  42. package/dist/chunk-AYAKU4YA.js.map +1 -0
  43. package/dist/chunk-B7EYTZRK.js +1 -0
  44. package/dist/chunk-B7EYTZRK.js.map +1 -0
  45. package/dist/{chunk-EBAHNZ36.js → chunk-CIULJH3G.js} +1 -1
  46. package/dist/{chunk-EBAHNZ36.js.map → chunk-CIULJH3G.js.map} +1 -1
  47. package/dist/{chunk-SNADUQSJ.js → chunk-CJK2IBI2.js} +1 -1
  48. package/dist/{chunk-SNADUQSJ.js.map → chunk-CJK2IBI2.js.map} +1 -1
  49. package/dist/{chunk-DYPOL3CI.js → chunk-CJQ37JII.js} +1 -1
  50. package/dist/chunk-CJQ37JII.js.map +1 -0
  51. package/dist/chunk-D6YEHR5S.js +1 -0
  52. package/dist/chunk-D6YEHR5S.js.map +1 -0
  53. package/dist/{chunk-Z6XMXMVI.js → chunk-DBDCOHI4.js} +1 -1
  54. package/dist/chunk-DBDCOHI4.js.map +1 -0
  55. package/dist/{chunk-AFVYCQWL.js → chunk-DCB4COCL.js} +1 -1
  56. package/dist/{chunk-AFVYCQWL.js.map → chunk-DCB4COCL.js.map} +1 -1
  57. package/dist/{chunk-CJWFY6OX.js → chunk-DSMLYA2M.js} +1 -1
  58. package/dist/{chunk-CJWFY6OX.js.map → chunk-DSMLYA2M.js.map} +1 -1
  59. package/dist/{chunk-UXBCLFGU.js → chunk-DWRNXUAX.js} +1 -1
  60. package/dist/{chunk-UXBCLFGU.js.map → chunk-DWRNXUAX.js.map} +1 -1
  61. package/dist/chunk-EVW4Z4CB.js +1 -0
  62. package/dist/chunk-EVW4Z4CB.js.map +1 -0
  63. package/dist/{chunk-4S6WB7QR.js → chunk-FF2X4K5P.js} +1 -1
  64. package/dist/chunk-FF2X4K5P.js.map +1 -0
  65. package/dist/chunk-FYVPZBXN.js +1 -0
  66. package/dist/chunk-FYVPZBXN.js.map +1 -0
  67. package/dist/{chunk-QTZPA2FR.js → chunk-GLWPSVFV.js} +1 -1
  68. package/dist/chunk-GLWPSVFV.js.map +1 -0
  69. package/dist/chunk-GZYPQIO2.js +1 -0
  70. package/dist/chunk-GZYPQIO2.js.map +1 -0
  71. package/dist/chunk-H47K3UWG.js +1 -0
  72. package/dist/chunk-H47K3UWG.js.map +1 -0
  73. package/dist/chunk-JGOAQLYW.js +1 -0
  74. package/dist/chunk-JGOAQLYW.js.map +1 -0
  75. package/dist/{chunk-JWWYAMGD.js → chunk-MGRDB2BZ.js} +1 -1
  76. package/dist/{chunk-JWWYAMGD.js.map → chunk-MGRDB2BZ.js.map} +1 -1
  77. package/dist/{chunk-MKGJPVPS.js → chunk-MRTTQYT5.js} +1 -1
  78. package/dist/{chunk-MKGJPVPS.js.map → chunk-MRTTQYT5.js.map} +1 -1
  79. package/dist/chunk-MTJ4MS7W.js +1 -0
  80. package/dist/chunk-MTJ4MS7W.js.map +1 -0
  81. package/dist/chunk-NIURLW2F.js +1 -0
  82. package/dist/chunk-NIURLW2F.js.map +1 -0
  83. package/dist/chunk-OLKNYGGT.js +1 -0
  84. package/dist/chunk-OLKNYGGT.js.map +1 -0
  85. package/dist/chunk-OYFMHDYT.js +1 -0
  86. package/dist/chunk-OYFMHDYT.js.map +1 -0
  87. package/dist/chunk-OYR5HUQZ.js +1 -0
  88. package/dist/chunk-OYR5HUQZ.js.map +1 -0
  89. package/dist/chunk-PL75RTA2.js +1 -0
  90. package/dist/{chunk-2VPVZELZ.js.map → chunk-PL75RTA2.js.map} +1 -1
  91. package/dist/chunk-PY5L6WC5.js +1 -0
  92. package/dist/chunk-PY5L6WC5.js.map +1 -0
  93. package/dist/{chunk-W6EPHHTS.js → chunk-Q2L75GSI.js} +1 -1
  94. package/dist/chunk-Q2L75GSI.js.map +1 -0
  95. package/dist/chunk-QJ7GB6FF.js +1 -0
  96. package/dist/chunk-QJ7GB6FF.js.map +1 -0
  97. package/dist/chunk-QTAMQ6ME.js +1 -0
  98. package/dist/chunk-QTAMQ6ME.js.map +1 -0
  99. package/dist/{chunk-FMPRCYKY.js → chunk-RRYBSAPX.js} +1 -1
  100. package/dist/chunk-RRYBSAPX.js.map +1 -0
  101. package/dist/{chunk-J42ZXLBL.js → chunk-T62GO4AA.js} +1 -1
  102. package/dist/chunk-T62GO4AA.js.map +1 -0
  103. package/dist/{chunk-E3BRVGJJ.js → chunk-TBZJIQ5P.js} +1 -1
  104. package/dist/{chunk-E3BRVGJJ.js.map → chunk-TBZJIQ5P.js.map} +1 -1
  105. package/dist/chunk-V3AEUBHV.js +1 -0
  106. package/dist/chunk-V3AEUBHV.js.map +1 -0
  107. package/dist/chunk-VYDQHPY2.js +1 -0
  108. package/dist/chunk-VYDQHPY2.js.map +1 -0
  109. package/dist/chunk-XUHAPOM6.js +1 -0
  110. package/dist/chunk-XUHAPOM6.js.map +1 -0
  111. package/dist/chunk-Y6KJJMIM.js +1 -0
  112. package/dist/chunk-Y6KJJMIM.js.map +1 -0
  113. package/dist/chunk-YXPZ7QQB.js +1 -0
  114. package/dist/chunk-YXPZ7QQB.js.map +1 -0
  115. package/dist/{chunk-Y6UZWNP4.js → chunk-ZCEAPJDH.js} +1 -1
  116. package/dist/{chunk-Y6UZWNP4.js.map → chunk-ZCEAPJDH.js.map} +1 -1
  117. package/dist/commodities/commodities.d.ts +20 -10
  118. package/dist/commodities/commodities.js +1 -1
  119. package/dist/commodities/index.d.ts +15 -4
  120. package/dist/commodities/index.js +1 -1
  121. package/dist/equipment/index.js +1 -1
  122. package/dist/equipment/modification-costs.d.ts +2 -1
  123. package/dist/equipment/modification-costs.js.map +1 -1
  124. package/dist/equipment/modification-journal.js +1 -1
  125. package/dist/equipment/modifications.d.ts +2 -1
  126. package/dist/equipment/modifications.js +1 -1
  127. package/dist/equipment/suits.d.ts +6 -3
  128. package/dist/equipment/suits.js +1 -1
  129. package/dist/equipment/upgrade-costs.d.ts +8 -4
  130. package/dist/equipment/upgrade-costs.js +1 -1
  131. package/dist/equipment/upgrade-costs.js.map +1 -1
  132. package/dist/equipment/weapons.d.ts +13 -5
  133. package/dist/equipment/weapons.js +1 -1
  134. package/dist/i18n/blueprints.d.ts +6 -6
  135. package/dist/i18n/blueprints.js +1 -1
  136. package/dist/i18n/diagnostics.d.ts +1 -13
  137. package/dist/i18n/engineering-groups.d.ts +1 -0
  138. package/dist/i18n/engineering-groups.js +1 -1
  139. package/dist/i18n/experimental-effect-descriptions.d.ts +4 -3
  140. package/dist/i18n/experimental-effect-descriptions.js +1 -1
  141. package/dist/i18n/experimental-effects.d.ts +5 -4
  142. package/dist/i18n/experimental-effects.js +1 -1
  143. package/dist/i18n/index.d.ts +1 -13
  144. package/dist/i18n/index.js +1 -1
  145. package/dist/i18n/pre-engineered.d.ts +7 -6
  146. package/dist/i18n/pre-engineered.js +1 -1
  147. package/dist/materials/index.d.ts +16 -4
  148. package/dist/materials/index.js +1 -1
  149. package/dist/materials/materials.d.ts +36 -19
  150. package/dist/materials/materials.js +1 -1
  151. package/dist/materials/micro-resources.d.ts +18 -7
  152. package/dist/materials/micro-resources.js +1 -1
  153. package/dist/ships/armour.d.ts +20 -4
  154. package/dist/ships/armour.js +1 -1
  155. package/dist/ships/blueprint-costs.d.ts +20 -17
  156. package/dist/ships/blueprint-costs.js +1 -1
  157. package/dist/ships/blueprint-journal.d.ts +9 -8
  158. package/dist/ships/blueprint-journal.js +1 -1
  159. package/dist/ships/blueprints.d.ts +14 -12
  160. package/dist/ships/blueprints.js +1 -1
  161. package/dist/ships/build-metrics.d.ts +1061 -0
  162. package/dist/ships/build-metrics.js +1 -0
  163. package/dist/ships/build-metrics.js.map +1 -0
  164. package/dist/ships/distributor.d.ts +10 -3
  165. package/dist/ships/distributor.js +1 -1
  166. package/dist/ships/engineering-options.d.ts +8 -6
  167. package/dist/ships/engineering-options.js +1 -1
  168. package/dist/ships/engineering.d.ts +2 -16
  169. package/dist/ships/engineering.js +1 -1
  170. package/dist/ships/experimental-effect-costs.d.ts +5 -5
  171. package/dist/ships/experimental-effect-costs.js +1 -1
  172. package/dist/ships/experimental-effects.d.ts +9 -8
  173. package/dist/ships/experimental-effects.js +1 -1
  174. package/dist/ships/heat.d.ts +7 -2
  175. package/dist/ships/heat.js +1 -1
  176. package/dist/ships/index.d.ts +34 -22
  177. package/dist/ships/index.js +1 -1
  178. package/dist/ships/jump-range.d.ts +10 -3
  179. package/dist/ships/jump-range.js +1 -1
  180. package/dist/ships/loadout-calculations.d.ts +1 -1
  181. package/dist/ships/loadout-calculations.js +1 -1
  182. package/dist/ships/mobility-capacitor.d.ts +90 -0
  183. package/dist/ships/mobility-capacitor.js +1 -0
  184. package/dist/ships/mobility-capacitor.js.map +1 -0
  185. package/dist/ships/mobility.d.ts +29 -17
  186. package/dist/ships/mobility.js +1 -1
  187. package/dist/ships/power.d.ts +12 -5
  188. package/dist/ships/power.js +1 -1
  189. package/dist/ships/pre-engineered-stats.d.ts +10 -8
  190. package/dist/ships/pre-engineered-stats.js +1 -1
  191. package/dist/ships/pre-engineered.d.ts +6 -6
  192. package/dist/ships/pre-engineered.js +1 -1
  193. package/dist/ships/resistances.d.ts +2 -2
  194. package/dist/ships/resistances.js +1 -1
  195. package/dist/ships/shield-capacitor.d.ts +133 -0
  196. package/dist/ships/shield-capacitor.js +1 -0
  197. package/dist/ships/shield-capacitor.js.map +1 -0
  198. package/dist/ships/shield-recovery.d.ts +16 -2
  199. package/dist/ships/shield-recovery.js +1 -1
  200. package/dist/ships/shields.d.ts +86 -28
  201. package/dist/ships/shields.js +1 -1
  202. package/dist/ships/ship-loadout.d.ts +91 -797
  203. package/dist/ships/ship-loadout.js +1 -1
  204. package/dist/ships/ships.d.ts +7 -6
  205. package/dist/ships/ships.js +1 -1
  206. package/dist/ships/slef.d.ts +1 -1
  207. package/dist/ships/source-purchase.d.ts +2 -1
  208. package/dist/ships/source-purchase.js +1 -1
  209. package/dist/ships/weapons-capacitor.d.ts +10 -3
  210. package/dist/ships/weapons-capacitor.js +1 -1
  211. package/dist/ships/weapons.d.ts +22 -6
  212. package/dist/ships/weapons.js +1 -1
  213. package/dist/{system-address-DYsN1qOT.d.ts → system-address-cyJaeZIS.d.ts} +2 -1
  214. package/package.json +17 -2
  215. package/dist/chunk-2FHHMYDC.js +0 -1
  216. package/dist/chunk-2FHHMYDC.js.map +0 -1
  217. package/dist/chunk-2TW4ZBI3.js +0 -1
  218. package/dist/chunk-2TW4ZBI3.js.map +0 -1
  219. package/dist/chunk-2VPVZELZ.js +0 -1
  220. package/dist/chunk-3BM5BHI3.js +0 -1
  221. package/dist/chunk-3BM5BHI3.js.map +0 -1
  222. package/dist/chunk-4S6WB7QR.js.map +0 -1
  223. package/dist/chunk-6BO5JJNI.js +0 -1
  224. package/dist/chunk-6BO5JJNI.js.map +0 -1
  225. package/dist/chunk-CX7B67OI.js +0 -1
  226. package/dist/chunk-CX7B67OI.js.map +0 -1
  227. package/dist/chunk-DVL5RBKX.js +0 -1
  228. package/dist/chunk-DVL5RBKX.js.map +0 -1
  229. package/dist/chunk-DYPOL3CI.js.map +0 -1
  230. package/dist/chunk-FGXWVFN6.js +0 -1
  231. package/dist/chunk-FGXWVFN6.js.map +0 -1
  232. package/dist/chunk-FMPRCYKY.js.map +0 -1
  233. package/dist/chunk-G3265B27.js +0 -1
  234. package/dist/chunk-G3265B27.js.map +0 -1
  235. package/dist/chunk-GQ5GX5TB.js.map +0 -1
  236. package/dist/chunk-IOJXLDJN.js +0 -1
  237. package/dist/chunk-IOJXLDJN.js.map +0 -1
  238. package/dist/chunk-IYU4WLFM.js +0 -1
  239. package/dist/chunk-IYU4WLFM.js.map +0 -1
  240. package/dist/chunk-J42ZXLBL.js.map +0 -1
  241. package/dist/chunk-JPBMRJFC.js.map +0 -1
  242. package/dist/chunk-LJI7VXJD.js +0 -1
  243. package/dist/chunk-LJI7VXJD.js.map +0 -1
  244. package/dist/chunk-OCND33TO.js +0 -1
  245. package/dist/chunk-OCND33TO.js.map +0 -1
  246. package/dist/chunk-P2QOL63K.js +0 -1
  247. package/dist/chunk-P2QOL63K.js.map +0 -1
  248. package/dist/chunk-Q3QCLNVG.js.map +0 -1
  249. package/dist/chunk-QTZPA2FR.js.map +0 -1
  250. package/dist/chunk-RLUS76LZ.js +0 -1
  251. package/dist/chunk-RLUS76LZ.js.map +0 -1
  252. package/dist/chunk-TEOJCBSG.js +0 -1
  253. package/dist/chunk-TEOJCBSG.js.map +0 -1
  254. package/dist/chunk-TMMGS6TC.js +0 -1
  255. package/dist/chunk-TMMGS6TC.js.map +0 -1
  256. package/dist/chunk-W6EPHHTS.js.map +0 -1
  257. package/dist/chunk-Z6XMXMVI.js.map +0 -1
  258. package/dist/chunk-ZNCXENNB.js +0 -1
  259. package/dist/chunk-ZNCXENNB.js.map +0 -1
  260. /package/dist/{chunk-6EUVIZAS.js.map → chunk-4QYTVSNR.js.map} +0 -0
  261. /package/dist/{chunk-6EPYVBAX.js.map → chunk-A6OINYNP.js.map} +0 -0
@@ -1,7 +1,10 @@
1
1
  /**
2
- * Data-free speed and handling calculations for a loaded ship. Speed and angular-rate
3
- * endpoints interpolate linearly by the ENG-PIP fraction before thruster mass curves
4
- * are applied.
2
+ * Data-free speed and handling calculations for a loaded ship, at **full ENG** — the
3
+ * hull's four-pip endpoints with the fitted thruster mass curves applied.
4
+ *
5
+ * The ENG capacitor is a separate story with its own entry point,
6
+ * `./mobility-capacitor`, which interpolates the hull's zero-pip endpoints towards the
7
+ * four-pip ones before the same curves are applied.
5
8
  *
6
9
  * Ported from EDCD/Coriolis and cross-checked against EDSY's mass-curve calculation;
7
10
  * see [`ATTRIBUTIONS.md`](https://github.com/DarkSession/Elite-Dangerous-Almanac/blob/main/ATTRIBUTIONS.md).
@@ -61,10 +64,15 @@ interface MobilityInput {
61
64
  readonly mass: number;
62
65
  /** The fitted thrusters' post-engineering curve, or no curve when none are fitted. */
63
66
  readonly thrusters?: ThrusterParams | null;
64
- /** Finite pips assigned to ENG, in `[0, 4]`. Defaults to `4`. */
65
- readonly enginesPips?: number;
66
67
  }
67
- /** Speed and rotation rates for one loaded ship. */
68
+ /**
69
+ * Speed and rotation rates for one loaded ship.
70
+ *
71
+ * @remarks
72
+ * Frozen — nested records and lists included — so a result can be held, cached and
73
+ * shared without a defensive copy. Derive a changed figure with a spread rather than
74
+ * by assigning into one.
75
+ */
68
76
  interface MobilityMetrics {
69
77
  /**
70
78
  * The loaded mass these figures were calculated at, in tonnes — the
@@ -78,15 +86,15 @@ interface MobilityMetrics {
78
86
  * move the ship at all — {@link massCurveMultiplier} is `0` there.
79
87
  */
80
88
  readonly loadedMass: number;
81
- /** Top speed at this mass and ENG allocation, in metres per second. */
89
+ /** Top speed at this mass and **four** ENG pips, in metres per second. */
82
90
  readonly speed: number;
83
- /** Boost speed at this mass, in metres per second. */
91
+ /** Boost speed at this mass, in metres per second. Boost ignores the ENG allocation. */
84
92
  readonly boost: number;
85
- /** Pitch rate at this mass and ENG allocation, in degrees per second. */
93
+ /** Pitch rate at this mass and **four** ENG pips, in degrees per second. */
86
94
  readonly pitch: number;
87
- /** Roll rate at this mass and ENG allocation, in degrees per second. */
95
+ /** Roll rate at this mass and **four** ENG pips, in degrees per second. */
88
96
  readonly roll: number;
89
- /** Yaw rate at this mass and ENG allocation, in degrees per second. */
97
+ /** Yaw rate at this mass and **four** ENG pips, in degrees per second. */
90
98
  readonly yaw: number;
91
99
  /** The thruster mass curve's performance multiplier at this loaded mass. */
92
100
  readonly massCurveMultiplier: number;
@@ -114,15 +122,19 @@ interface MobilityMetrics {
114
122
  */
115
123
  declare function thrusterMassCurveMultiplier(mass: number, thrusters: ThrusterCurveParams): number;
116
124
  /**
117
- * Calculate a loaded ship's top speed, boost speed and rotation rates.
125
+ * Calculate a loaded ship's top speed, boost speed and rotation rates at **full ENG**.
118
126
  *
119
127
  * @remarks
120
- * Speed, pitch, roll and yaw interpolate linearly from their installed zero-ENG-PIP
121
- * endpoints to their four-PIP endpoints. The fitted thruster's speed and rotation
122
- * mass-curve multipliers are then applied to those interpolated hull values. Boost is
123
- * independent of ENG allocation and uses the speed curve at the loaded mass.
128
+ * Speed, pitch, roll and yaw are the hull's four-ENG-PIP endpoints with the fitted
129
+ * thruster's speed and rotation mass-curve multipliers applied. Boost is independent of
130
+ * the ENG allocation and uses the speed curve at the loaded mass, so it is the same
131
+ * figure whatever the pips.
132
+ *
133
+ * A **lower** allocation is {@link mobilityCapacitorMetrics}: it interpolates each figure
134
+ * from the hull's zero-pip endpoint (`minimumSpeed`, `minPitch`, `minRoll`, `minYaw`)
135
+ * towards the endpoint used here, and applies the same curves.
124
136
  *
125
- * @param input - Hull figures, loaded mass, fitted thrusters and ENG pips.
137
+ * @param input - Hull figures, loaded mass and fitted thrusters.
126
138
  * @returns The build's {@link MobilityMetrics}, or `null` without thrusters. A mass above
127
139
  * the thrusters' maximum returns zero performance rather than a fabricated curve value.
128
140
  * @throws {RangeError} If an input is not finite or is outside its documented range,
@@ -1 +1 @@
1
- export{mobilityMetrics,thrusterMassCurveMultiplier}from"../chunk-CX7B67OI.js";//# sourceMappingURL=mobility.js.map
1
+ export{mobilityMetrics,thrusterMassCurveMultiplier}from"../chunk-Y6KJJMIM.js"; //# sourceMappingURL=mobility.js.map
@@ -10,8 +10,8 @@
10
10
  * whose running total would go over, along with everything below it.
11
11
  *
12
12
  * This module is data-free: hand {@link powerBudget} the plant's capacity and a
13
- * {@link PowerConsumer} per fitted module. {@link ShipLoadout.powerBudget} (in
14
- * `./ship-loadout`) builds that list from a build for you, post-engineering.
13
+ * {@link PowerConsumer} per fitted module. {@link BuildMetrics.powerBudget} (in
14
+ * `./build-metrics`) builds that list from a build for you, post-engineering.
15
15
  *
16
16
  * @remarks
17
17
  * Reference implementation: EDCD/Coriolis, `src/app/shipyard/Ship.js`
@@ -93,7 +93,14 @@ interface PowerBand {
93
93
  /** Whether this group stays powered with hardpoints deployed. */
94
94
  readonly poweredDeployed: boolean;
95
95
  }
96
- /** What a build's power plant makes and what the build asks of it. */
96
+ /**
97
+ * What a build's power plant makes and what the build asks of it.
98
+ *
99
+ * @remarks
100
+ * Frozen — nested records and lists included — so a result can be held, cached and
101
+ * shared without a defensive copy. Derive a changed figure with a spread rather than
102
+ * by assigning into one.
103
+ */
97
104
  interface PowerBudget {
98
105
  /** Power the plant generates, in megawatts, post-engineering. */
99
106
  readonly available: number;
@@ -117,7 +124,7 @@ interface PowerBudget {
117
124
  readonly bands: readonly PowerBand[];
118
125
  /**
119
126
  * Every supplied consumer in source order, including switched-off entries. Enabled
120
- * entries reconcile with the band and aggregate totals. {@link ShipLoadout.powerBudget}
127
+ * entries reconcile with the band and aggregate totals. {@link BuildMetrics.powerBudget}
121
128
  * supplies only modules with a positive draw; passive and zero-draw fittings are absent.
122
129
  */
123
130
  readonly consumers: readonly PowerConsumerResult[];
@@ -130,7 +137,7 @@ interface PowerBudget {
130
137
  * fitted — every group then reads as unpowered). Must be finite and non-negative.
131
138
  * @param consumers - Power consumers to include. Modules with `enabled: false` are
132
139
  * skipped from totals; the rest fall into their {@link PowerConsumer.priority | priority}
133
- * group. {@link ShipLoadout.powerBudget} omits passive and zero-draw fittings.
140
+ * group. {@link BuildMetrics.powerBudget} omits passive and zero-draw fittings.
134
141
  * @returns The {@link PowerBudget}.
135
142
  * @throws {RangeError} If `available` or any consumer's `draw` is not a finite
136
143
  * non-negative number.
@@ -1 +1 @@
1
- export{powerBudget}from"../chunk-RLUS76LZ.js";//# sourceMappingURL=power.js.map
1
+ export{powerBudget}from"../chunk-D6YEHR5S.js";//# sourceMappingURL=power.js.map
@@ -15,8 +15,8 @@ import './slots.js';
15
15
  * arrives, not as the stock module leaves the shipyard. That is what
16
16
  * {@link getPreEngineeredStats} returns.
17
17
  *
18
- * This module imports every module record to resolve stats. Its resolver is 343.9 KiB
19
- * minified in a consumer bundle; the complete runtime API is 376.2 KiB (41.6 KiB
18
+ * This module imports every module record to resolve stats. Its resolver is 362.5 KiB
19
+ * minified in a consumer bundle; the complete runtime API is 396.3 KiB (43.1 KiB
20
20
  * gzipped). Consumers that only list variants can import `./pre-engineered.js` without
21
21
  * these module catalogues.
22
22
  * A journal or SLEF module can instead be classified with
@@ -52,7 +52,7 @@ import './slots.js';
52
52
  * import { getPreEngineeredModifiers } from '@elite-dangerous-almanac/core/ships/pre-engineered-stats';
53
53
  *
54
54
  * const railgun = getPreEngineeredVariants('Hpt_Railgun_Fixed_Medium')
55
- * .find((variant) => variant.blueprint === 'Weapon_HighCapacity');
55
+ * .find((variant) => variant.blueprintSymbol === 'Weapon_HighCapacity');
56
56
  * if (railgun) getPreEngineeredModifiers(railgun);
57
57
  * // -> [{ Label: 'Mass', Value: 2.85, OriginalValue: 1.5 }, ...]
58
58
  * ```
@@ -76,7 +76,7 @@ declare function getPreEngineeredModifiers(variant: PreEngineeredVariant): Engin
76
76
  * import { getPreEngineeredJournalModifiers } from '@elite-dangerous-almanac/core/ships/pre-engineered-stats';
77
77
  *
78
78
  * const red = getPreEngineeredVariants('Hpt_FlakMortar_Turret_Medium')
79
- * .find((variant) => variant.blueprint === 'Decorative_Red')!;
79
+ * .find((variant) => variant.blueprintSymbol === 'Decorative_Red')!;
80
80
  * getPreEngineeredJournalModifiers(red);
81
81
  * // -> [{ Label: 'DamagePerSecond', Value: 0.17, OriginalValue: 17 }, { Label: 'Damage', Value: 0.34, OriginalValue: 34 }]
82
82
  * ```
@@ -165,13 +165,15 @@ declare function unresolvedModifiers(variant: PreEngineeredVariant): string[];
165
165
  * Exact damage components scale with an engineered `damage` value so their proportions
166
166
  * and the anti-xeno overlay remain coherent with the resolved scalar.
167
167
  *
168
- * A variant with no stat block (every `mercenary` row) resolves to the base record
169
- * unchanged, which is the honest answer — the pre-engineering those arrive with is not
170
- * published anywhere, so the catalogue does not guess at it.
168
+ * A variant with no stat block (every `mercenary` row) resolves to a copy of the base
169
+ * record with nothing changed, which is the honest answer — the pre-engineering those
170
+ * arrive with is not published anywhere, so the catalogue does not guess at it.
171
171
  *
172
172
  * @param variant - A pre-engineered variant.
173
173
  * @returns The resolved module record, or `null` when the variant's symbol is not in the
174
- * module catalogues.
174
+ * module catalogues. It is always a record of your own — never the shared catalogue
175
+ * singleton — so you may adjust it before fitting it; its nested values are still the
176
+ * catalogue's frozen ones, so replace them rather than write into them.
175
177
  *
176
178
  * @example
177
179
  * ```ts
@@ -1 +1 @@
1
- export{getPreEngineeredJournalModifiers,getPreEngineeredModifiers,getPreEngineeredStats,identifyPreEngineeredVariant,unresolvedModifiers}from"../chunk-6BO5JJNI.js"; //# sourceMappingURL=pre-engineered-stats.js.map
1
+ export{getPreEngineeredJournalModifiers,getPreEngineeredModifiers,getPreEngineeredStats,identifyPreEngineeredVariant,unresolvedModifiers}from"../chunk-GZYPQIO2.js"; //# sourceMappingURL=pre-engineered-stats.js.map
@@ -97,15 +97,15 @@ interface PreEngineeredVariant {
97
97
  * against it prices ordinary engineering rather than the reward. Read `modifiers`
98
98
  * for what the article actually carries.
99
99
  */
100
- readonly blueprint: string;
100
+ readonly blueprintSymbol: string;
101
101
  /** The engineering grade already applied (1–5). */
102
102
  readonly grade: number;
103
103
  /**
104
- * The experimental effect's Frontier `fdname`, e.g.
104
+ * The experimental effect's Frontier symbol, e.g.
105
105
  * `"special_feedback_cascade_cooled"`. Joins to `EXPERIMENTAL_EFFECTS`. Absent when
106
106
  * the variant carries none.
107
107
  */
108
- readonly experimental?: string;
108
+ readonly experimentalEffectSymbol?: string;
109
109
  /** Where the variant comes from. */
110
110
  readonly acquisition: PreEngineeredAcquisition;
111
111
  /**
@@ -152,7 +152,7 @@ interface PreEngineeredVariant {
152
152
  * PRE_ENGINEERED_MODULES.length; // -> 76
153
153
  * PRE_ENGINEERED_MODULES[0];
154
154
  * // -> { symbol: 'Hpt_Mining_AbrBlstr_Fixed_Small', name: 'Abrasion Blaster',
155
- * // blueprint: 'AbrasionBlaster_FarReaching', grade: 1,
155
+ * // blueprintSymbol: 'AbrasionBlaster_FarReaching', grade: 1,
156
156
  * // acquisition: 'mercenary', mercCoinCost: 400 }
157
157
  * ```
158
158
  */
@@ -173,7 +173,7 @@ declare const PRE_ENGINEERED_MODULES: readonly PreEngineeredVariant[];
173
173
  * ```ts
174
174
  * import { getPreEngineeredVariants } from '@elite-dangerous-almanac/core/ships/pre-engineered';
175
175
  *
176
- * getPreEngineeredVariants('Hpt_BasicMissileRack_Fixed_Medium').map((v) => v.blueprint);
176
+ * getPreEngineeredVariants('Hpt_BasicMissileRack_Fixed_Medium').map((v) => v.blueprintSymbol);
177
177
  * // -> ['SeekerMissileRack_Drag',
178
178
  * // 'SeekerMissileRack_LightWeightThermal',
179
179
  * // 'SeekerMissileRackMedium_Lockdown',
@@ -186,7 +186,7 @@ declare function getPreEngineeredVariants(symbol: string): readonly PreEngineere
186
186
  /**
187
187
  * Whether a module has at least one known pre-engineered form.
188
188
  *
189
- * @param symbol - A module symbol.
189
+ * @param symbol - A module symbol. Leading/trailing whitespace and case are ignored.
190
190
  * @returns `true` when {@link getPreEngineeredVariants} would return anything.
191
191
  *
192
192
  * @throws {TypeError} If `symbol` is present and not a string. A nullish
@@ -1 +1 @@
1
- export{PRE_ENGINEERED_MODULES,getPreEngineeredVariants,isPreEngineered}from"../chunk-2VPVZELZ.js"; //# sourceMappingURL=pre-engineered.js.map
1
+ export{PRE_ENGINEERED_MODULES,getPreEngineeredVariants,isPreEngineered}from"../chunk-PL75RTA2.js"; //# sourceMappingURL=pre-engineered.js.map
@@ -18,8 +18,8 @@
18
18
  * multiplier (capped at `0.7`), the range `[0, max]` is squeezed into `[0.35, max]`.
19
19
  * If the squeeze would *raise* the multiplier above `0.7`, the plain product stands.
20
20
  *
21
- * This module is data-free — pass fractions in, get fractions out. {@link ShipLoadout}
22
- * (`./ship-loadout`), `./shields` and `./armour` gather the numbers for you.
21
+ * This module is data-free — pass fractions in, get fractions out. {@link BuildMetrics}
22
+ * (`./build-metrics`), `./shields` and `./armour` gather the numbers for you.
23
23
  *
24
24
  * @remarks
25
25
  * Reference implementation: EDCD/Coriolis,
@@ -1 +1 @@
1
- export{effectiveHitPoints,mapDamageTypes,stackArmourResistance,stackShieldResistance,systemsResistance}from"../chunk-ZNCXENNB.js";//# sourceMappingURL=resistances.js.map
1
+ export{effectiveHitPoints,mapDamageTypes,stackArmourResistance,stackShieldResistance,systemsResistance}from"../chunk-JGOAQLYW.js"; //# sourceMappingURL=resistances.js.map
@@ -0,0 +1,133 @@
1
+ import { DamageResistances, DamageTypeValues } from './resistances.js';
2
+
3
+ /**
4
+ * **The SYS capacitor** — what pips to SYS buy a raised shield, and what the shield is
5
+ * worth once they are folded in.
6
+ *
7
+ * SYS does two things at once. It **resists**: the allocation adds a flat resistance to
8
+ * every damage type, which multiplies with the shield's own stack rather than adding to
9
+ * it, so incoming damage is scaled by `(1 − shieldResistance) × (1 − sysResistance)`. And
10
+ * it **recharges**: the capacitor's energy is what the generator spends putting the
11
+ * shield back up, on the same non-linear pip curve the other two capacitors follow,
12
+ * `ratedRecharge × (pips / 4) ^ 1.1`.
13
+ *
14
+ * ```text
15
+ * sysResistance = 0.6 × (pips / 4) ^ 0.85
16
+ * effectiveResistance = 1 − (1 − shieldResistance) × (1 − sysResistance)
17
+ * effectiveHitPoints = strength / (1 − effectiveResistance)
18
+ * ```
19
+ *
20
+ * The bare shield those effective figures are built from is {@link shieldMetrics}, which
21
+ * is pip-free. What the recharge reported here *buys* — seconds from collapse back to a
22
+ * raised shield — is {@link shieldRecovery}, which takes the same allocation and the
23
+ * generator's regeneration rates.
24
+ *
25
+ * This module is data-free. {@link BuildMetrics.shieldCapacitorMetrics} (in
26
+ * `./build-metrics`) resolves the powered generator, boosters and distributor for you.
27
+ *
28
+ * @remarks
29
+ * Reference implementation: EDCD/Coriolis, `src/app/shipyard/Calculations.js`
30
+ * (`sysResistance`, `calcShieldStrength`), commit
31
+ * `68c042ca6e3db62372cbbb2077cf972345511712`. The algorithm is ported as fact, not code;
32
+ * credit and licence terms are in
33
+ * [ATTRIBUTIONS.md](https://github.com/DarkSession/Elite-Dangerous-Almanac/blob/main/ATTRIBUTIONS.md).
34
+ *
35
+ * @packageDocumentation
36
+ */
37
+
38
+ /** Everything {@link shieldCapacitorMetrics} needs about one raised shield. */
39
+ interface ShieldCapacitorInput {
40
+ /**
41
+ * The shield's total strength, in megajoules — finite and non-negative.
42
+ * {@link ShieldMetrics.strength}.
43
+ */
44
+ readonly strength: number;
45
+ /**
46
+ * The shield's own stacked resistances, pip-free — every one a finite fraction.
47
+ * {@link ShieldMetrics.resistances}.
48
+ */
49
+ readonly resistances: DamageResistances;
50
+ /** SYS-capacitor capacity, in megajoules — finite and non-negative. */
51
+ readonly systemsCapacity: number;
52
+ /** Four-SYS-pip recharge rate, in megajoules per second — finite and non-negative. */
53
+ readonly systemsRecharge: number;
54
+ /** Pips assigned to SYS, in `[0, 4]`. Fractional pips are accepted; defaults to `4`. */
55
+ readonly systemsPips?: number;
56
+ }
57
+ /**
58
+ * What one SYS allocation is worth to a raised shield.
59
+ *
60
+ * @remarks
61
+ * Frozen — nested records and lists included — so a result can be held, cached and
62
+ * shared without a defensive copy. Derive a changed figure with a spread rather than
63
+ * by assigning into one.
64
+ */
65
+ interface ShieldCapacitorMetrics {
66
+ /** Pips assigned to SYS for this result, in `[0, 4]`. */
67
+ readonly systemsPips: number;
68
+ /** SYS-capacitor capacity, in megajoules. */
69
+ readonly capacity: number;
70
+ /** Actual recharge rate at {@link systemsPips}, in megajoules per second. */
71
+ readonly rechargeRate: number;
72
+ /**
73
+ * The resistance the pips contribute on their own, as a fraction: `0` at no pips
74
+ * rising to `0.6` at four. Unrounded, like every resistance here.
75
+ */
76
+ readonly systemsResistance: number;
77
+ /**
78
+ * The shield's resistances with the pips folded in — the figures the game's own
79
+ * panel shows while the allocation stands.
80
+ *
81
+ * @remarks
82
+ * Fractions rather than percentages, and **unrounded**. The pips multiply with the
83
+ * shield's stack rather than adding to it, so these are
84
+ * `1 − (1 − shieldResistance) × (1 − systemsResistance)` and not a sum.
85
+ */
86
+ readonly effectiveResistances: DamageResistances;
87
+ /**
88
+ * Effective hit points against each damage type, in megajoules, behind
89
+ * {@link ShieldCapacitorMetrics.effectiveResistances} — the raw damage of that type
90
+ * the shield soaks at this allocation. `Infinity` where a resistance reaches 100%.
91
+ */
92
+ readonly effectiveHitPoints: DamageTypeValues;
93
+ }
94
+ /**
95
+ * Calculate what a SYS-pip allocation gives a raised shield.
96
+ *
97
+ * @param input - The bare shield's strength and stacked resistances, the distributor's
98
+ * SYS capacity and rated four-pip recharge, and the allocation to model.
99
+ * @returns The {@link ShieldCapacitorMetrics}. At **no** pips `systemsResistance` and
100
+ * `rechargeRate` are `0` and the effective figures equal the bare ones that went in.
101
+ * @throws {RangeError} If `systemsPips` is outside `[0, 4]`, if a strength, capacity or
102
+ * recharge is negative or non-finite, or if a resistance is not a finite number. The
103
+ * pips are checked first, so a bad allocation is reported before the shield.
104
+ * @throws {TypeError} If `resistances` is not an object carrying the four damage types.
105
+ * @example
106
+ * ```ts
107
+ * import { shieldMetrics } from '@elite-dangerous-almanac/core/ships/shields';
108
+ * import { shieldCapacitorMetrics } from '@elite-dangerous-almanac/core/ships/shield-capacitor';
109
+ *
110
+ * // The bare shield, then what four pips to SYS make of it.
111
+ * const shields = shieldMetrics({
112
+ * hullMass: 400,
113
+ * baseShieldStrength: 350,
114
+ * generator: {
115
+ * minMass: 270, optMass: 540, maxMass: 1350,
116
+ * minMultiplier: 0.7, optMultiplier: 1.2, maxMultiplier: 1.7,
117
+ * kineticResistance: 0.4,
118
+ * },
119
+ * });
120
+ * const sys = shieldCapacitorMetrics({
121
+ * ...shields,
122
+ * systemsCapacity: 41,
123
+ * systemsRecharge: 3.9,
124
+ * systemsPips: 4,
125
+ * });
126
+ * Number(sys.systemsResistance.toFixed(2)); // -> 0.6
127
+ * Number(sys.effectiveResistances.kinetic.toFixed(2)); // -> 0.76
128
+ * sys.effectiveHitPoints.kinetic > shields.effectiveHitPoints.kinetic; // -> true
129
+ * ```
130
+ */
131
+ declare function shieldCapacitorMetrics(input: ShieldCapacitorInput): ShieldCapacitorMetrics;
132
+
133
+ export { type ShieldCapacitorInput, type ShieldCapacitorMetrics, shieldCapacitorMetrics };
@@ -0,0 +1 @@
1
+ export{shieldCapacitorMetrics}from"../chunk-6L56LWTT.js"; //# sourceMappingURL=shield-capacitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"O"}
@@ -24,7 +24,14 @@ interface ShieldRecoveryInput {
24
24
  /** Finite pips assigned to SYS, in `[0, 4]`. Defaults to `4`. */
25
25
  readonly systemsPips?: number;
26
26
  }
27
- /** Time and rates for a shield to return after collapsing. */
27
+ /**
28
+ * Time and rates for a shield to return after collapsing.
29
+ *
30
+ * @remarks
31
+ * Frozen — nested records and lists included — so a result can be held, cached and
32
+ * shared without a defensive copy. Derive a changed figure with a spread rather than
33
+ * by assigning into one.
34
+ */
28
35
  interface ShieldRecovery {
29
36
  /** Megajoules per second regenerated while the shield is raised. */
30
37
  readonly regenRate: number;
@@ -73,7 +80,14 @@ interface CellBankMetrics {
73
80
  /** Whether the fitted bank is switched on and receiving power. */
74
81
  readonly powered: boolean;
75
82
  }
76
- /** Every fitted shield cell bank and the combined pool available from powered banks. */
83
+ /**
84
+ * Every fitted shield cell bank and the combined pool available from powered banks.
85
+ *
86
+ * @remarks
87
+ * Frozen — nested records and lists included — so a result can be held, cached and
88
+ * shared without a defensive copy. Derive a changed figure with a spread rather than
89
+ * by assigning into one.
90
+ */
77
91
  interface CellBankSummary {
78
92
  /** Fitted banks in slot order. */
79
93
  readonly banks: readonly CellBankMetrics[];
@@ -1 +1 @@
1
- export{cellBankSummary,shieldRecovery}from"../chunk-VZZUNSDF.js"; //# sourceMappingURL=shield-recovery.js.map
1
+ export{cellBankSummary,shieldRecovery}from"../chunk-4KJ7CR74.js"; //# sourceMappingURL=shield-recovery.js.map
@@ -1,4 +1,4 @@
1
- import { DamageResistanceParams, DamageResistances, DamageTypeValues } from './resistances.js';
1
+ import { DamageResistances, DamageTypeValues, DamageResistanceParams } from './resistances.js';
2
2
 
3
3
  /**
4
4
  * **Shields** — strength in megajoules and the resistances that decide what that
@@ -16,9 +16,10 @@ import { DamageResistanceParams, DamageResistances, DamageTypeValues } from './r
16
16
  * ```
17
17
  *
18
18
  * Resistances stack separately, with their own diminishing returns — see
19
- * `./resistances`.
19
+ * `./resistances`. Everything here is **pip-free**: the SYS capacitor's own resistance,
20
+ * and the effective figures it buys, live in `./shield-capacitor`.
20
21
  *
21
- * This module is data-free. {@link ShipLoadout.shieldMetrics} (in `./ship-loadout`)
22
+ * This module is data-free. {@link BuildMetrics.shieldMetrics} (in `./build-metrics`)
22
23
  * pulls the generator, boosters and reinforcement packages out of a build,
23
24
  * post-engineering, and calls {@link shieldMetrics} for you.
24
25
  *
@@ -56,6 +57,13 @@ import { DamageResistanceParams, DamageResistances, DamageTypeValues } from './r
56
57
  * moves. Every field is optional because the type accepts those records; a generator
57
58
  * **missing** any of the six curve fields cannot be placed on the curve at all, and
58
59
  * raises no shield ({@link shieldMassCurveMultiplier} returns `0`).
60
+ *
61
+ * A generator that carries all six is held to the curve's shape: every value finite and
62
+ * non-negative, masses strictly ordered `minMass < optMass < maxMass` (or all equal, for
63
+ * a constant curve), multipliers strictly ordered
64
+ * `minMultiplier < optMultiplier < maxMultiplier` (or all equal), and equal multipliers
65
+ * wherever the masses are all equal. Anything else is a `RangeError` rather than a
66
+ * plausible-looking number.
59
67
  */
60
68
  interface ShieldGeneratorParams extends DamageResistanceParams {
61
69
  /** Hull mass at which the generator performs at `maxMultiplier`, in tonnes. */
@@ -101,15 +109,15 @@ interface ShieldInput {
101
109
  * {@link ShieldMetrics.reinforcement} is `0`.
102
110
  */
103
111
  readonly reinforcement?: number;
104
- /**
105
- * Pips to the systems capacitor, `0`–`4`, folded into the reported resistances when
106
- * a generator is fitted; with none, they are reported only as
107
- * {@link ShieldMetrics.systemsResistance}.
108
- * Defaults to `0` — the bare shield, as an outfitting screen shows it.
109
- */
110
- readonly systemsPips?: number;
111
112
  }
112
- /** A build's shield strength, where it comes from, and what it resists. */
113
+ /**
114
+ * A build's shield strength, where it comes from, and what it resists.
115
+ *
116
+ * @remarks
117
+ * Frozen — nested records and lists included — so a result can be held, cached and
118
+ * shared without a defensive copy. Derive a changed figure with a spread rather than
119
+ * by assigning into one.
120
+ */
113
121
  interface ShieldMetrics {
114
122
  /** Total shield strength, in megajoules. `0` when no generator is fitted. */
115
123
  readonly strength: number;
@@ -131,9 +139,17 @@ interface ShieldMetrics {
131
139
  */
132
140
  readonly boostMultiplier: number;
133
141
  /**
134
- * Effective resistances, generator and boosters stacked with diminishing returns,
135
- * and the SYS pips folded in. `0` for every damage type when no generator is fitted;
136
- * the pips are then reported only in {@link ShieldMetrics.systemsResistance}.
142
+ * Effective resistances, generator and boosters stacked with diminishing returns.
143
+ * The SYS pips are **not** in these — they belong to the capacitor, and
144
+ * {@link shieldCapacitorMetrics} folds them in. `0` for every damage type when no
145
+ * generator is fitted.
146
+ *
147
+ * @remarks
148
+ * Fractions rather than percentages, and **unrounded**: the stacking is
149
+ * floating-point arithmetic, so a nominal −20% reads as `-0.19999999999999996`
150
+ * rather than `-0.2`. Round where the figure is displayed, not before it is
151
+ * composed further — {@link ShieldMetrics.effectiveHitPoints} is derived from
152
+ * exactly these values.
137
153
  */
138
154
  readonly resistances: DamageResistances;
139
155
  /**
@@ -142,24 +158,35 @@ interface ShieldMetrics {
142
158
  * `Infinity` where a resistance reaches 100%.
143
159
  */
144
160
  readonly effectiveHitPoints: DamageTypeValues;
145
- /** The extra resistance the SYS pips contribute, as a fraction. */
146
- readonly systemsResistance: number;
147
161
  }
148
162
  /**
149
163
  * A shield generator's strength multiplier at a given hull mass.
150
164
  *
151
- * @param hullMass - The **hull's** mass, in tonnes (not the loaded ship's).
152
- * @param generator - The generator's mass/multiplier curve, post-engineering.
165
+ * @param hullMass - The **hull's** mass, in tonnes (not the loaded ship's). Finite and
166
+ * non-negative.
167
+ * @param generator - The generator's mass/multiplier curve, post-engineering. Either all
168
+ * six curve fields, or a record the catalogue left incomplete — see the `0` cases below.
153
169
  * @returns The multiplier to apply to the hull's base shield strength: `minMultiplier`
154
170
  * for a hull sitting exactly on `maxMass`, no more than `maxMultiplier` for a
155
171
  * featherweight one, and **`0` past `maxMass`** — a generator cannot raise a shield
156
172
  * around a hull heavier than it is rated for. Also `0` for a generator whose record is
157
173
  * missing part of its curve.
174
+ * @throws {RangeError} If `hullMass` is not a finite number of zero or more, or if the
175
+ * generator carries all six curve fields and they are not a physical curve: every one
176
+ * has to be finite and non-negative, the masses strictly ordered
177
+ * `minMass < optMass < maxMass` (or all equal, for a constant curve), the multipliers
178
+ * strictly ordered `minMultiplier < optMultiplier < maxMultiplier` (or all equal), and an
179
+ * all-equal mass curve must have equal multipliers. A curve that is merely *absent* still
180
+ * answers `0`: a catalogue record missing any of the six fields is incomplete data, not a
181
+ * non-physical curve, and this is the only mass-curve outcome that is not a number or a
182
+ * throw.
158
183
  * @remarks
159
184
  * The curve is a power law fitted through the generator's three declared points:
160
185
  * normalize the mass into `[0, 1]` between `maxMass` and `minMass`, raise it to the
161
186
  * exponent that makes the curve pass through `(optMass, optMultiplier)`, then
162
- * interpolate between `minMultiplier` and `maxMultiplier`.
187
+ * interpolate between `minMultiplier` and `maxMultiplier`. It is the same curve
188
+ * `thrusterMassCurveMultiplier` reads a thruster's performance off, and the two agree on
189
+ * every input they both accept.
163
190
  * @example
164
191
  * ```ts
165
192
  * import { shieldMassCurveMultiplier } from '@elite-dangerous-almanac/core/ships/shields';
@@ -170,6 +197,24 @@ interface ShieldMetrics {
170
197
  * minMultiplier: 0.7, optMultiplier: 1.2, maxMultiplier: 1.7,
171
198
  * }); // -> 1.434…
172
199
  * ```
200
+ * @example
201
+ * ```ts
202
+ * import { shieldMassCurveMultiplier } from '@elite-dangerous-almanac/core/ships/shields';
203
+ *
204
+ * // A generator whose optimal mass sits on its maximum is not a curve at all
205
+ * try {
206
+ * shieldMassCurveMultiplier(400, {
207
+ * minMass: 270, optMass: 1350, maxMass: 1350,
208
+ * minMultiplier: 0.7, optMultiplier: 1.2, maxMultiplier: 1.7,
209
+ * });
210
+ * } catch (error) {
211
+ * (error as Error).message;
212
+ * // -> 'shieldMassCurveMultiplier: generator: masses must be strictly ordered minMass < optMass < maxMass, or all equal'
213
+ * }
214
+ *
215
+ * // A record the catalogue left incomplete is data that is missing, not data that is wrong
216
+ * shieldMassCurveMultiplier(400, { optMass: 540, optMultiplier: 1.2 }); // -> 0
217
+ * ```
173
218
  */
174
219
  declare function shieldMassCurveMultiplier(hullMass: number, generator: ShieldGeneratorParams): number;
175
220
  /**
@@ -180,24 +225,37 @@ declare function shieldMassCurveMultiplier(hullMass: number, generator: ShieldGe
180
225
  * @param generator - The fitted generator, post-engineering.
181
226
  * @param boostMultiplier - The boosters' combined multiplier — `1 + Σ shieldBoost`.
182
227
  * Defaults to `1` (no boosters).
183
- * @returns The shield's megajoules, before any Guardian reinforcement addition.
228
+ * @returns The shield's megajoules, before any Guardian reinforcement addition. `0` for a
229
+ * hull past the generator's `maxMass`, and `0` for a generator whose record is missing
230
+ * part of its curve — see {@link shieldMassCurveMultiplier}.
231
+ * @throws {RangeError} If `hullMass` is not a finite number of zero or more, or the
232
+ * generator carries a complete but non-physical curve — the contract
233
+ * {@link shieldMassCurveMultiplier} documents, reported as `shieldStrength`.
184
234
  */
185
235
  declare function shieldStrength(hullMass: number, baseShieldStrength: number, generator: ShieldGeneratorParams, boostMultiplier?: number): number;
186
236
  /**
187
- * Everything an outfitting screen shows about a build's shields: strength, where it
188
- * comes from, and the effective resistances.
237
+ * A build's bare shields: strength, where it comes from, and the resistances the
238
+ * generator and boosters stack up between them.
239
+ *
240
+ * These are the **pip-free** figures, the ones an outfitting screen shows. The SYS
241
+ * capacitor is a separate story with its own entry point,
242
+ * {@link shieldCapacitorMetrics}, which takes what this returns and folds a pip
243
+ * allocation into it.
189
244
  *
190
245
  * @param input - The hull's mass and base shield strength, the fitted generator, and
191
- * any powered boosters, Guardian reinforcement and SYS pips.
246
+ * any powered boosters and Guardian reinforcement.
192
247
  * @returns The {@link ShieldMetrics}. With no generator fitted there is no shield for
193
248
  * a resistance to apply to: every strength figure is `0` — any `reinforcement` passed is
194
249
  * dropped, since a Guardian package has no shield to reinforce — and `resistances` and
195
- * `effectiveHitPoints` are `0` for every damage type, so a hull with no shields gets no
196
- * benefit from the SYS pips. The pips are still reported on their own, as
197
- * `systemsResistance`. `massCurveMultiplier` is `0` and `boostMultiplier` is `1`,
250
+ * `effectiveHitPoints` are `0` for every damage type.
251
+ * `massCurveMultiplier` is `0` and `boostMultiplier` is `1`,
198
252
  * whatever boosters are fitted, since there is no generator strength to multiply.
199
- * @throws {RangeError} If `systemsPips` is not a finite number in `[0, 4]`. The pips are
200
- * checked before the generator, so this applies with no generator fitted too.
253
+ * @throws {RangeError} With a generator fitted, if `hullMass` is not a finite number of
254
+ * zero or more, or the generator
255
+ * carries a complete but non-physical curve — the contract
256
+ * {@link shieldMassCurveMultiplier} documents, reported as `shieldMetrics`. A generator
257
+ * whose record is simply *missing* part of its curve is not a failure: `hullMass` is
258
+ * never read, and `massCurveMultiplier` and every strength figure are `0`.
201
259
  * @example
202
260
  * ```ts
203
261
  * import { shieldMetrics } from '@elite-dangerous-almanac/core/ships/shields';
@@ -1 +1 @@
1
- export{shieldMassCurveMultiplier,shieldMetrics,shieldStrength}from"../chunk-2FHHMYDC.js"; //# sourceMappingURL=shields.js.map
1
+ export{shieldMassCurveMultiplier,shieldMetrics,shieldStrength}from"../chunk-QTAMQ6ME.js"; //# sourceMappingURL=shields.js.map