@elite-dangerous-almanac/core 0.1.0-beta.1
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/LICENSE +48 -0
- package/PROVENANCE/SNAPSHOTS.md +36 -0
- package/PROVENANCE/astro/SOURCES.md +94 -0
- package/PROVENANCE/commodities/SOURCES.md +41 -0
- package/PROVENANCE/materials/SOURCES.md +69 -0
- package/PROVENANCE/ships/SOURCES.md +1580 -0
- package/README.md +148 -0
- package/THIRD_PARTY_NOTICES.md +202 -0
- package/dist/astro/codex-region-lookup.d.ts +169 -0
- package/dist/astro/codex-region-lookup.js +1 -0
- package/dist/astro/codex-region-lookup.js.map +1 -0
- package/dist/astro/codex-region.d.ts +149 -0
- package/dist/astro/codex-region.js +1 -0
- package/dist/astro/codex-region.js.map +1 -0
- package/dist/astro/galaxy-grid.d.ts +83 -0
- package/dist/astro/galaxy-grid.js +1 -0
- package/dist/astro/galaxy-grid.js.map +1 -0
- package/dist/astro/hand-authored-regions.d.ts +121 -0
- package/dist/astro/hand-authored-regions.js +1 -0
- package/dist/astro/hand-authored-regions.js.map +1 -0
- package/dist/astro/index.d.ts +140 -0
- package/dist/astro/index.js +1 -0
- package/dist/astro/index.js.map +1 -0
- package/dist/astro/mass-code.d.ts +55 -0
- package/dist/astro/mass-code.js +1 -0
- package/dist/astro/mass-code.js.map +1 -0
- package/dist/astro/naming-region-origins.d.ts +4 -0
- package/dist/astro/naming-region-origins.js +1 -0
- package/dist/astro/naming-region-origins.js.map +1 -0
- package/dist/astro/nebulae-all.d.ts +40 -0
- package/dist/astro/nebulae-all.js +1 -0
- package/dist/astro/nebulae-all.js.map +1 -0
- package/dist/astro/nebulae-planetary.d.ts +37 -0
- package/dist/astro/nebulae-planetary.js +1 -0
- package/dist/astro/nebulae-planetary.js.map +1 -0
- package/dist/astro/nebulae-procgen.d.ts +36 -0
- package/dist/astro/nebulae-procgen.js +1 -0
- package/dist/astro/nebulae-procgen.js.map +1 -0
- package/dist/astro/nebulae-real.d.ts +37 -0
- package/dist/astro/nebulae-real.js +1 -0
- package/dist/astro/nebulae-real.js.map +1 -0
- package/dist/astro/nebulae.d.ts +169 -0
- package/dist/astro/nebulae.js +1 -0
- package/dist/astro/nebulae.js.map +1 -0
- package/dist/astro/permit-locked-regions.d.ts +54 -0
- package/dist/astro/permit-locked-regions.js +1 -0
- package/dist/astro/permit-locked-regions.js.map +1 -0
- package/dist/astro/permit-locked-systems.d.ts +74 -0
- package/dist/astro/permit-locked-systems.js +1 -0
- package/dist/astro/permit-locked-systems.js.map +1 -0
- package/dist/astro/permit-locks.d.ts +130 -0
- package/dist/astro/permit-locks.js +1 -0
- package/dist/astro/permit-locks.js.map +1 -0
- package/dist/astro/procedural-system.d.ts +228 -0
- package/dist/astro/procedural-system.js +1 -0
- package/dist/astro/procedural-system.js.map +1 -0
- package/dist/astro/sector-name.d.ts +87 -0
- package/dist/astro/sector-name.js +1 -0
- package/dist/astro/sector-name.js.map +1 -0
- package/dist/astro/system-address-input.d.ts +76 -0
- package/dist/astro/system-address-input.js +1 -0
- package/dist/astro/system-address-input.js.map +1 -0
- package/dist/astro/system-address.d.ts +4 -0
- package/dist/astro/system-address.js +1 -0
- package/dist/astro/system-address.js.map +1 -0
- package/dist/astro/system-name.d.ts +187 -0
- package/dist/astro/system-name.js +1 -0
- package/dist/astro/system-name.js.map +1 -0
- package/dist/chunk-2FHHMYDC.js +1 -0
- package/dist/chunk-2FHHMYDC.js.map +1 -0
- package/dist/chunk-462OKHXR.js +1 -0
- package/dist/chunk-462OKHXR.js.map +1 -0
- package/dist/chunk-5H74FKY7.js +1 -0
- package/dist/chunk-5H74FKY7.js.map +1 -0
- package/dist/chunk-6LUEKHO5.js +1 -0
- package/dist/chunk-6LUEKHO5.js.map +1 -0
- package/dist/chunk-76XKY2Y2.js +1 -0
- package/dist/chunk-76XKY2Y2.js.map +1 -0
- package/dist/chunk-7EE5VIHR.js +1 -0
- package/dist/chunk-7EE5VIHR.js.map +1 -0
- package/dist/chunk-A3NM7SAJ.js +1 -0
- package/dist/chunk-A3NM7SAJ.js.map +1 -0
- package/dist/chunk-A6XPYSVR.js +1 -0
- package/dist/chunk-A6XPYSVR.js.map +1 -0
- package/dist/chunk-AA3K5XUE.js +1 -0
- package/dist/chunk-AA3K5XUE.js.map +1 -0
- package/dist/chunk-AVZI6VKA.js +1 -0
- package/dist/chunk-AVZI6VKA.js.map +1 -0
- package/dist/chunk-B5TT26XE.js +1 -0
- package/dist/chunk-B5TT26XE.js.map +1 -0
- package/dist/chunk-BNILZXJD.js +1 -0
- package/dist/chunk-BNILZXJD.js.map +1 -0
- package/dist/chunk-BRDQUJXV.js +1 -0
- package/dist/chunk-BRDQUJXV.js.map +1 -0
- package/dist/chunk-BTPV5CIF.js +1 -0
- package/dist/chunk-BTPV5CIF.js.map +1 -0
- package/dist/chunk-CI3ACMRA.js +1 -0
- package/dist/chunk-CI3ACMRA.js.map +1 -0
- package/dist/chunk-COE5ADYJ.js +1 -0
- package/dist/chunk-COE5ADYJ.js.map +1 -0
- package/dist/chunk-CWAX3BSH.js +1 -0
- package/dist/chunk-CWAX3BSH.js.map +1 -0
- package/dist/chunk-DACZE3HX.js +1 -0
- package/dist/chunk-DACZE3HX.js.map +1 -0
- package/dist/chunk-DURKO7JU.js +1 -0
- package/dist/chunk-DURKO7JU.js.map +1 -0
- package/dist/chunk-E45EDCYH.js +1 -0
- package/dist/chunk-E45EDCYH.js.map +1 -0
- package/dist/chunk-ELIZXUMI.js +1 -0
- package/dist/chunk-ELIZXUMI.js.map +1 -0
- package/dist/chunk-EYGVDJ2I.js +1 -0
- package/dist/chunk-EYGVDJ2I.js.map +1 -0
- package/dist/chunk-FGXWVFN6.js +1 -0
- package/dist/chunk-FGXWVFN6.js.map +1 -0
- package/dist/chunk-GJCB2Z72.js +1 -0
- package/dist/chunk-GJCB2Z72.js.map +1 -0
- package/dist/chunk-HI7FCS3G.js +1 -0
- package/dist/chunk-HI7FCS3G.js.map +1 -0
- package/dist/chunk-HKXXFIRI.js +1 -0
- package/dist/chunk-HKXXFIRI.js.map +1 -0
- package/dist/chunk-HTB52N6S.js +1 -0
- package/dist/chunk-HTB52N6S.js.map +1 -0
- package/dist/chunk-I7PIDRMU.js +1 -0
- package/dist/chunk-I7PIDRMU.js.map +1 -0
- package/dist/chunk-IH4NXKVW.js +1 -0
- package/dist/chunk-IH4NXKVW.js.map +1 -0
- package/dist/chunk-INNFH37U.js +1 -0
- package/dist/chunk-INNFH37U.js.map +1 -0
- package/dist/chunk-J2PNZQY4.js +1 -0
- package/dist/chunk-J2PNZQY4.js.map +1 -0
- package/dist/chunk-JQG4C67D.js +1 -0
- package/dist/chunk-JQG4C67D.js.map +1 -0
- package/dist/chunk-JTQVWIGL.js +1 -0
- package/dist/chunk-JTQVWIGL.js.map +1 -0
- package/dist/chunk-JWJ7RSZC.js +1 -0
- package/dist/chunk-JWJ7RSZC.js.map +1 -0
- package/dist/chunk-K3AMV27L.js +1 -0
- package/dist/chunk-K3AMV27L.js.map +1 -0
- package/dist/chunk-K7F6WC4T.js +1 -0
- package/dist/chunk-K7F6WC4T.js.map +1 -0
- package/dist/chunk-K7L7SMIR.js +1 -0
- package/dist/chunk-K7L7SMIR.js.map +1 -0
- package/dist/chunk-KG4EWDZZ.js +1 -0
- package/dist/chunk-KG4EWDZZ.js.map +1 -0
- package/dist/chunk-KMFUCORC.js +1 -0
- package/dist/chunk-KMFUCORC.js.map +1 -0
- package/dist/chunk-L2ZZXEZM.js +1 -0
- package/dist/chunk-L2ZZXEZM.js.map +1 -0
- package/dist/chunk-L747RVPO.js +1 -0
- package/dist/chunk-L747RVPO.js.map +1 -0
- package/dist/chunk-MFV4VZFP.js +1 -0
- package/dist/chunk-MFV4VZFP.js.map +1 -0
- package/dist/chunk-NWPK6Q3S.js +1 -0
- package/dist/chunk-NWPK6Q3S.js.map +1 -0
- package/dist/chunk-PMJG7PHU.js +1 -0
- package/dist/chunk-PMJG7PHU.js.map +1 -0
- package/dist/chunk-PP2VSA6M.js +1 -0
- package/dist/chunk-PP2VSA6M.js.map +1 -0
- package/dist/chunk-Q22LXT53.js +1 -0
- package/dist/chunk-Q22LXT53.js.map +1 -0
- package/dist/chunk-Q5MR36RW.js +1 -0
- package/dist/chunk-Q5MR36RW.js.map +1 -0
- package/dist/chunk-Q5XOGATC.js +1 -0
- package/dist/chunk-Q5XOGATC.js.map +1 -0
- package/dist/chunk-QTDBO7R2.js +1 -0
- package/dist/chunk-QTDBO7R2.js.map +1 -0
- package/dist/chunk-R4OD62HV.js +1 -0
- package/dist/chunk-R4OD62HV.js.map +1 -0
- package/dist/chunk-RD73TFGS.js +1 -0
- package/dist/chunk-RD73TFGS.js.map +1 -0
- package/dist/chunk-RIT6MOO5.js +1 -0
- package/dist/chunk-RIT6MOO5.js.map +1 -0
- package/dist/chunk-RVSXKQHE.js +1 -0
- package/dist/chunk-RVSXKQHE.js.map +1 -0
- package/dist/chunk-S4DBNX2B.js +1 -0
- package/dist/chunk-S4DBNX2B.js.map +1 -0
- package/dist/chunk-S4UWCHL6.js +1 -0
- package/dist/chunk-S4UWCHL6.js.map +1 -0
- package/dist/chunk-SQS7672E.js +1 -0
- package/dist/chunk-SQS7672E.js.map +1 -0
- package/dist/chunk-TLNHETGC.js +1 -0
- package/dist/chunk-TLNHETGC.js.map +1 -0
- package/dist/chunk-U6TMCYA6.js +1 -0
- package/dist/chunk-U6TMCYA6.js.map +1 -0
- package/dist/chunk-V4C6FIE2.js +1 -0
- package/dist/chunk-V4C6FIE2.js.map +1 -0
- package/dist/chunk-VXVUEF5U.js +1 -0
- package/dist/chunk-VXVUEF5U.js.map +1 -0
- package/dist/chunk-VZXL5KBR.js +1 -0
- package/dist/chunk-VZXL5KBR.js.map +1 -0
- package/dist/chunk-VZZ2XIRE.js +1 -0
- package/dist/chunk-VZZ2XIRE.js.map +1 -0
- package/dist/chunk-WV5YM7H5.js +1 -0
- package/dist/chunk-WV5YM7H5.js.map +1 -0
- package/dist/chunk-Y2MUIE5W.js +1 -0
- package/dist/chunk-Y2MUIE5W.js.map +1 -0
- package/dist/chunk-Z43DN4PY.js +1 -0
- package/dist/chunk-Z43DN4PY.js.map +1 -0
- package/dist/chunk-Z4GTTB7I.js +1 -0
- package/dist/chunk-Z4GTTB7I.js.map +1 -0
- package/dist/chunk-Z4OUB4SJ.js +1 -0
- package/dist/chunk-Z4OUB4SJ.js.map +1 -0
- package/dist/chunk-ZFT56QFR.js +1 -0
- package/dist/chunk-ZFT56QFR.js.map +1 -0
- package/dist/chunk-ZNCXENNB.js +1 -0
- package/dist/chunk-ZNCXENNB.js.map +1 -0
- package/dist/commodities/commodities-all.d.ts +25 -0
- package/dist/commodities/commodities-all.js +1 -0
- package/dist/commodities/commodities-all.js.map +1 -0
- package/dist/commodities/commodities-rare.d.ts +34 -0
- package/dist/commodities/commodities-rare.js +1 -0
- package/dist/commodities/commodities-rare.js.map +1 -0
- package/dist/commodities/commodities-standard.d.ts +34 -0
- package/dist/commodities/commodities-standard.js +1 -0
- package/dist/commodities/commodities-standard.js.map +1 -0
- package/dist/commodities/commodities.d.ts +142 -0
- package/dist/commodities/commodities.js +1 -0
- package/dist/commodities/commodities.js.map +1 -0
- package/dist/commodities/index.d.ts +30 -0
- package/dist/commodities/index.js +1 -0
- package/dist/commodities/index.js.map +1 -0
- package/dist/galactic-position-shLkm4Qg.d.ts +30 -0
- package/dist/materials/index.d.ts +47 -0
- package/dist/materials/index.js +1 -0
- package/dist/materials/index.js.map +1 -0
- package/dist/materials/materials-all.d.ts +26 -0
- package/dist/materials/materials-all.js +1 -0
- package/dist/materials/materials-all.js.map +1 -0
- package/dist/materials/materials-encoded.d.ts +31 -0
- package/dist/materials/materials-encoded.js +1 -0
- package/dist/materials/materials-encoded.js.map +1 -0
- package/dist/materials/materials-manufactured.d.ts +32 -0
- package/dist/materials/materials-manufactured.js +1 -0
- package/dist/materials/materials-manufactured.js.map +1 -0
- package/dist/materials/materials-raw.d.ts +31 -0
- package/dist/materials/materials-raw.js +1 -0
- package/dist/materials/materials-raw.js.map +1 -0
- package/dist/materials/materials.d.ts +277 -0
- package/dist/materials/materials.js +1 -0
- package/dist/materials/materials.js.map +1 -0
- package/dist/materials/micro-resources-all.d.ts +28 -0
- package/dist/materials/micro-resources-all.js +1 -0
- package/dist/materials/micro-resources-all.js.map +1 -0
- package/dist/materials/micro-resources-component.d.ts +29 -0
- package/dist/materials/micro-resources-component.js +1 -0
- package/dist/materials/micro-resources-component.js.map +1 -0
- package/dist/materials/micro-resources-consumable.d.ts +29 -0
- package/dist/materials/micro-resources-consumable.js +1 -0
- package/dist/materials/micro-resources-consumable.js.map +1 -0
- package/dist/materials/micro-resources-data.d.ts +29 -0
- package/dist/materials/micro-resources-data.js +1 -0
- package/dist/materials/micro-resources-data.js.map +1 -0
- package/dist/materials/micro-resources-item.d.ts +29 -0
- package/dist/materials/micro-resources-item.js +1 -0
- package/dist/materials/micro-resources-item.js.map +1 -0
- package/dist/materials/micro-resources.d.ts +136 -0
- package/dist/materials/micro-resources.js +1 -0
- package/dist/materials/micro-resources.js.map +1 -0
- package/dist/ship-loadout-Ba63RDf-.d.ts +1059 -0
- package/dist/ships/ammunition.d.ts +107 -0
- package/dist/ships/ammunition.js +1 -0
- package/dist/ships/ammunition.js.map +1 -0
- package/dist/ships/armour.d.ts +134 -0
- package/dist/ships/armour.js +1 -0
- package/dist/ships/armour.js.map +1 -0
- package/dist/ships/blueprint-costs.d.ts +128 -0
- package/dist/ships/blueprint-costs.js +1 -0
- package/dist/ships/blueprint-costs.js.map +1 -0
- package/dist/ships/blueprint-journal.d.ts +116 -0
- package/dist/ships/blueprint-journal.js +1 -0
- package/dist/ships/blueprint-journal.js.map +1 -0
- package/dist/ships/blueprints.d.ts +103 -0
- package/dist/ships/blueprints.js +1 -0
- package/dist/ships/blueprints.js.map +1 -0
- package/dist/ships/decorative-modifications.d.ts +176 -0
- package/dist/ships/decorative-modifications.js +1 -0
- package/dist/ships/decorative-modifications.js.map +1 -0
- package/dist/ships/engineering-options.d.ts +246 -0
- package/dist/ships/engineering-options.js +1 -0
- package/dist/ships/engineering-options.js.map +1 -0
- package/dist/ships/engineering.d.ts +229 -0
- package/dist/ships/engineering.js +1 -0
- package/dist/ships/engineering.js.map +1 -0
- package/dist/ships/experimental-effect-costs.d.ts +56 -0
- package/dist/ships/experimental-effect-costs.js +1 -0
- package/dist/ships/experimental-effect-costs.js.map +1 -0
- package/dist/ships/experimental-effects.d.ts +62 -0
- package/dist/ships/experimental-effects.js +1 -0
- package/dist/ships/experimental-effects.js.map +1 -0
- package/dist/ships/index.d.ts +205 -0
- package/dist/ships/index.js +1 -0
- package/dist/ships/index.js.map +1 -0
- package/dist/ships/jump-range.d.ts +115 -0
- package/dist/ships/jump-range.js +1 -0
- package/dist/ships/jump-range.js.map +1 -0
- package/dist/ships/loadout-calculations.d.ts +109 -0
- package/dist/ships/loadout-calculations.js +1 -0
- package/dist/ships/loadout-calculations.js.map +1 -0
- package/dist/ships/loadout-validation.d.ts +80 -0
- package/dist/ships/loadout-validation.js +1 -0
- package/dist/ships/loadout-validation.js.map +1 -0
- package/dist/ships/module-capabilities.d.ts +205 -0
- package/dist/ships/module-capabilities.js +1 -0
- package/dist/ships/module-capabilities.js.map +1 -0
- package/dist/ships/modules-all.d.ts +43 -0
- package/dist/ships/modules-all.js +1 -0
- package/dist/ships/modules-all.js.map +1 -0
- package/dist/ships/modules-core.d.ts +40 -0
- package/dist/ships/modules-core.js +1 -0
- package/dist/ships/modules-core.js.map +1 -0
- package/dist/ships/modules-hardpoint.d.ts +42 -0
- package/dist/ships/modules-hardpoint.js +1 -0
- package/dist/ships/modules-hardpoint.js.map +1 -0
- package/dist/ships/modules-internal.d.ts +40 -0
- package/dist/ships/modules-internal.js +1 -0
- package/dist/ships/modules-internal.js.map +1 -0
- package/dist/ships/modules-utility.d.ts +40 -0
- package/dist/ships/modules-utility.js +1 -0
- package/dist/ships/modules-utility.js.map +1 -0
- package/dist/ships/modules.d.ts +755 -0
- package/dist/ships/modules.js +1 -0
- package/dist/ships/modules.js.map +1 -0
- package/dist/ships/power.d.ts +168 -0
- package/dist/ships/power.js +1 -0
- package/dist/ships/power.js.map +1 -0
- package/dist/ships/pre-engineered-stats.d.ts +147 -0
- package/dist/ships/pre-engineered-stats.js +1 -0
- package/dist/ships/pre-engineered-stats.js.map +1 -0
- package/dist/ships/pre-engineered.d.ts +215 -0
- package/dist/ships/pre-engineered.js +1 -0
- package/dist/ships/pre-engineered.js.map +1 -0
- package/dist/ships/resistances.d.ts +208 -0
- package/dist/ships/resistances.js +1 -0
- package/dist/ships/resistances.js.map +1 -0
- package/dist/ships/shields.d.ts +221 -0
- package/dist/ships/shields.js +1 -0
- package/dist/ships/shields.js.map +1 -0
- package/dist/ships/ship-loadout.d.ts +16 -0
- package/dist/ships/ship-loadout.js +1 -0
- package/dist/ships/ship-loadout.js.map +1 -0
- package/dist/ships/ships.d.ts +191 -0
- package/dist/ships/ships.js +1 -0
- package/dist/ships/ships.js.map +1 -0
- package/dist/ships/slef.d.ts +318 -0
- package/dist/ships/slef.js +1 -0
- package/dist/ships/slef.js.map +1 -0
- package/dist/ships/slots.d.ts +418 -0
- package/dist/ships/slots.js +1 -0
- package/dist/ships/slots.js.map +1 -0
- package/dist/ships/source-purchase.d.ts +132 -0
- package/dist/ships/source-purchase.js +1 -0
- package/dist/ships/source-purchase.js.map +1 -0
- package/dist/ships/weapons.d.ts +380 -0
- package/dist/ships/weapons.js +1 -0
- package/dist/ships/weapons.js.map +1 -0
- package/dist/system-address-DYsN1qOT.d.ts +313 -0
- package/package.json +375 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { DamageDistribution, DamageComponents, ProjectileRangeBoundaries } from './modules.js';
|
|
2
|
+
import './engineering-options.js';
|
|
3
|
+
import './slots.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* **Weapons** — damage per second, capacitor draw per second, heat per second, and how
|
|
7
|
+
* the damage splits by type.
|
|
8
|
+
*
|
|
9
|
+
* A weapon's catalogue record gives damage *per round*; turning that into DPS means
|
|
10
|
+
* folding in the rounds per shot and the rate of fire, and — for the **sustained**
|
|
11
|
+
* figures — the clip and reload, because a weapon that stops to reload is not firing:
|
|
12
|
+
*
|
|
13
|
+
* ```text
|
|
14
|
+
* DPS = damage × roundsPerShot × rateOfFire
|
|
15
|
+
* SDPS = DPS × (sustained rate of fire / rate of fire)
|
|
16
|
+
* EPS = distributorDraw × rateOfFire (weapons capacitor, MW)
|
|
17
|
+
* HPS = thermalLoad × rateOfFire (heat)
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Beam and mining lasers are **continuous**: they carry no rate of fire, and their
|
|
21
|
+
* `damage`, `distributorDraw` and `thermalLoad` are already per second, so the figures
|
|
22
|
+
* above collapse to the raw stats.
|
|
23
|
+
*
|
|
24
|
+
* This module is data-free — hand it a weapon's stats (a catalogue record satisfies
|
|
25
|
+
* {@link WeaponStats} as-is). {@link ShipLoadout.weaponMetrics} (in `./ship-loadout`)
|
|
26
|
+
* reads a build's hardpoints, applies their engineering, and totals them for you.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Reference implementation: EDCD/Coriolis, `src/app/shipyard/Module.js` (`getDps`,
|
|
30
|
+
* `getSustainedFactor`, `getEps`, `getHps`), commit
|
|
31
|
+
* `68c042ca6e3db62372cbbb2077cf972345511712`; cross-checked against EDSY. The algorithm is
|
|
32
|
+
* ported as fact, not code; credit and licence terms are in [ATTRIBUTIONS.md](https://github.com/DarkSession/Elite-Dangerous-Almanac/blob/main/ATTRIBUTIONS.md).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { weaponMetrics } from '@elite-dangerous-almanac/core/ships/weapons';
|
|
37
|
+
* import { getModuleBySymbol } from '@elite-dangerous-almanac/core/ships/modules';
|
|
38
|
+
* import { HARDPOINT_MODULES } from '@elite-dangerous-almanac/core/ships/modules-hardpoint';
|
|
39
|
+
*
|
|
40
|
+
* const mc = getModuleBySymbol('Hpt_MultiCannon_Fixed_Small', HARDPOINT_MODULES)!;
|
|
41
|
+
* weaponMetrics(mc).damagePerSecond; // -> 8.62 (while firing, reloads ignored)
|
|
42
|
+
* weaponMetrics(mc).sustainedDamagePerSecond; // -> 6.64 (with the 4 s reload)
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @packageDocumentation
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The weapon stats a DPS calculation needs — all post-engineering.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* An {@link OutfittingModule} record satisfies this as-is, so you can pass a catalogue
|
|
53
|
+
* entry straight in. Every field is optional: a weapon carries only the ones that
|
|
54
|
+
* apply to it. Fields used directly by these calculations state their omitted
|
|
55
|
+
* behavior below; informational fields remain absent when unknown or inapplicable.
|
|
56
|
+
*/
|
|
57
|
+
interface WeaponStats {
|
|
58
|
+
/** Damage per round — or per second on a continuous-fire weapon. Defaults to `0`. */
|
|
59
|
+
readonly damage?: number;
|
|
60
|
+
/** How the damage splits by type. Defaults to all-absolute if absent. */
|
|
61
|
+
readonly damageDistribution?: DamageDistribution;
|
|
62
|
+
/** Exact damage amounts. When present, these are authoritative for damage splits. */
|
|
63
|
+
readonly damageComponents?: DamageComponents;
|
|
64
|
+
/** Rounds fired per shot. Defaults to `1`. */
|
|
65
|
+
readonly roundsPerShot?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Shots per second, burst pattern folded in. Absent marks a **continuous-fire**
|
|
68
|
+
* weapon, whose per-second stats are used as they stand.
|
|
69
|
+
*/
|
|
70
|
+
readonly rateOfFire?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Seconds between shots — between *bursts* on a burst-fire weapon. Only
|
|
73
|
+
* {@link combinedRateOfFire} uses it; the per-second figures work off
|
|
74
|
+
* {@link WeaponStats.rateOfFire}.
|
|
75
|
+
*/
|
|
76
|
+
readonly burstInterval?: number;
|
|
77
|
+
/** Shots in one burst. Defaults to `1`. */
|
|
78
|
+
readonly burstRounds?: number;
|
|
79
|
+
/** Shots per second within a burst. Defaults to `1`. */
|
|
80
|
+
readonly burstRateOfFire?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Seconds spent charging before a shot (rail guns). Absent means no charge delay is
|
|
83
|
+
* recorded; these calculations do not fold charge time into `rateOfFire` or DPS.
|
|
84
|
+
*/
|
|
85
|
+
readonly chargeTime?: number;
|
|
86
|
+
/** Rounds in a clip. Absent means the weapon never stops to reload. */
|
|
87
|
+
readonly clipSize?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Reserve rounds behind the clip. Absent means nothing limits them.
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* No per-second figure reads it — a reserve says how long a weapon can keep firing,
|
|
93
|
+
* not how hard. It is carried here so `weaponStatsFor` hands
|
|
94
|
+
* {@link ammunitionCapacity} everything it needs from one record.
|
|
95
|
+
*/
|
|
96
|
+
readonly ammoMaximum?: number;
|
|
97
|
+
/** Seconds to reload a clip. Defaults to `0`. */
|
|
98
|
+
readonly reloadTime?: number;
|
|
99
|
+
/** Weapons-capacitor draw per shot (per second when continuous), in MW. Defaults to `0`. */
|
|
100
|
+
readonly distributorDraw?: number;
|
|
101
|
+
/** Heat per shot (per second when continuous). Defaults to `0`. */
|
|
102
|
+
readonly thermalLoad?: number;
|
|
103
|
+
/** Power draw, in megawatts — echoed through to the metrics. Defaults to `0`. */
|
|
104
|
+
readonly powerDraw?: number;
|
|
105
|
+
/** Maximum range, in metres. Absent means {@link damageFalloff} imposes no range cap. */
|
|
106
|
+
readonly maximumRange?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Range at which damage begins to drop off, in metres. Absent means full damage
|
|
109
|
+
* through `maximumRange`, then zero beyond it.
|
|
110
|
+
*/
|
|
111
|
+
readonly falloffRange?: number;
|
|
112
|
+
/**
|
|
113
|
+
* Projectile boundary parameters, which are not effective distances. Absent means
|
|
114
|
+
* no boundary metadata is known; {@link damageFalloff} ignores it either way.
|
|
115
|
+
*/
|
|
116
|
+
readonly projectileRange?: ProjectileRangeBoundaries;
|
|
117
|
+
/**
|
|
118
|
+
* Armour piercing rating, against a hull's hardness. Absent means the rating is
|
|
119
|
+
* unknown; callers of {@link armourPiercingFactor} must supply an explicit value.
|
|
120
|
+
*/
|
|
121
|
+
readonly armourPiercing?: number;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Damage split across the established, unclassified and anti-xeno types, in the same
|
|
125
|
+
* unit as the figure it splits (for example, damage per second when splitting DPS).
|
|
126
|
+
*/
|
|
127
|
+
interface DamageSplit {
|
|
128
|
+
/** Kinetic share. */
|
|
129
|
+
readonly kinetic: number;
|
|
130
|
+
/** Thermal share. */
|
|
131
|
+
readonly thermal: number;
|
|
132
|
+
/** Explosive share. */
|
|
133
|
+
readonly explosive: number;
|
|
134
|
+
/** Absolute share — the part no resistance reduces. */
|
|
135
|
+
readonly absolute: number;
|
|
136
|
+
/** Damage unclassified by in-game verification. Absent when zero. */
|
|
137
|
+
readonly unclassified?: number;
|
|
138
|
+
/**
|
|
139
|
+
* The part effective against Thargoids. Overlays conventional damage rather than
|
|
140
|
+
* partitioning it, so it is not part of the conventional total.
|
|
141
|
+
*/
|
|
142
|
+
readonly antiXeno: number;
|
|
143
|
+
}
|
|
144
|
+
/** What one weapon does per second, sustained and unsustained. */
|
|
145
|
+
interface WeaponMetrics {
|
|
146
|
+
/** Damage of one shot — `damage × roundsPerShot`. */
|
|
147
|
+
readonly damagePerShot: number;
|
|
148
|
+
/** Shots per second; `1` on a continuous-fire weapon, whose stats are per second. */
|
|
149
|
+
readonly rateOfFire: number;
|
|
150
|
+
/** Shots per second averaged over reloads. Equals `rateOfFire` when nothing reloads. */
|
|
151
|
+
readonly sustainedRateOfFire: number;
|
|
152
|
+
/** Damage per second while firing, reloads ignored. */
|
|
153
|
+
readonly damagePerSecond: number;
|
|
154
|
+
/** Damage per second averaged over reloads — the figure a long fight sees. */
|
|
155
|
+
readonly sustainedDamagePerSecond: number;
|
|
156
|
+
/** Weapons-capacitor draw per second, in MW, reloads ignored. */
|
|
157
|
+
readonly energyPerSecond: number;
|
|
158
|
+
/** Weapons-capacitor draw per second, in MW, averaged over reloads. */
|
|
159
|
+
readonly sustainedEnergyPerSecond: number;
|
|
160
|
+
/** Heat per second while firing, reloads ignored. */
|
|
161
|
+
readonly heatPerSecond: number;
|
|
162
|
+
/** Heat per second averaged over reloads. */
|
|
163
|
+
readonly sustainedHeatPerSecond: number;
|
|
164
|
+
/** Power draw, in megawatts — what the weapon asks of the power plant when deployed. */
|
|
165
|
+
readonly powerDraw: number;
|
|
166
|
+
/**
|
|
167
|
+
* {@link damagePerSecond} split by damage type.
|
|
168
|
+
*
|
|
169
|
+
* @remarks
|
|
170
|
+
* Uses the split supplied in {@link WeaponStats}. {@link ShipLoadout.weaponMetrics}
|
|
171
|
+
* resolves damage-converting experimental effects, Plasma Conversion blueprints and
|
|
172
|
+
* a journal's own damage-type modifiers before calling this calculation, so fitted
|
|
173
|
+
* conversions report their resulting split.
|
|
174
|
+
*/
|
|
175
|
+
readonly damageByType: DamageSplit;
|
|
176
|
+
/** {@link sustainedDamagePerSecond} split by damage type. */
|
|
177
|
+
readonly sustainedDamageByType: DamageSplit;
|
|
178
|
+
/** Whether the weapon fires continuously (a beam or mining laser). */
|
|
179
|
+
readonly continuous: boolean;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* The additive firepower totals across several weapons.
|
|
183
|
+
*
|
|
184
|
+
* @remarks
|
|
185
|
+
* Per-shot damage, rate of fire and continuous-fire state belong to one weapon and
|
|
186
|
+
* therefore do not appear here: adding a beam laser's cadence to a multi-cannon's does
|
|
187
|
+
* not describe either weapon or the build. Use the individual {@link WeaponMetrics}
|
|
188
|
+
* when those figures matter.
|
|
189
|
+
*/
|
|
190
|
+
interface WeaponTotals {
|
|
191
|
+
/** Damage per second while firing, summed across the weapons. */
|
|
192
|
+
readonly damagePerSecond: number;
|
|
193
|
+
/** Damage per second averaged over reloads, summed across the weapons. */
|
|
194
|
+
readonly sustainedDamagePerSecond: number;
|
|
195
|
+
/** Weapons-capacitor draw per second, in MW, summed across the weapons. */
|
|
196
|
+
readonly energyPerSecond: number;
|
|
197
|
+
/** Weapons-capacitor draw per second averaged over reloads, in MW. */
|
|
198
|
+
readonly sustainedEnergyPerSecond: number;
|
|
199
|
+
/** Heat generated per second while firing, summed across the weapons. */
|
|
200
|
+
readonly heatPerSecond: number;
|
|
201
|
+
/** Heat generated per second averaged over reloads, summed across the weapons. */
|
|
202
|
+
readonly sustainedHeatPerSecond: number;
|
|
203
|
+
/** Deployed power draw, in MW, summed across the weapons. */
|
|
204
|
+
readonly powerDraw: number;
|
|
205
|
+
/** {@link damagePerSecond} split by damage type. */
|
|
206
|
+
readonly damageByType: DamageSplit;
|
|
207
|
+
/** {@link sustainedDamagePerSecond} split by damage type. */
|
|
208
|
+
readonly sustainedDamageByType: DamageSplit;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* The combined rate of fire a weapon's firing cycle implies — the journal's own
|
|
212
|
+
* `RateOfFire`, rebuilt from its parts.
|
|
213
|
+
*
|
|
214
|
+
* A cycle fires `burstRounds` shots `1 / burstRateOfFire` apart, then waits out the
|
|
215
|
+
* `burstInterval` before the next one. `chargeTime` is the delay before a shot lands,
|
|
216
|
+
* not part of the cadence Frontier reports as `RateOfFire`.
|
|
217
|
+
*
|
|
218
|
+
* @param weapon - The weapon's stats, post-engineering.
|
|
219
|
+
* @returns Shots per second, or `undefined` for a continuous-fire weapon (no
|
|
220
|
+
* `burstInterval`) or a cycle that does not resolve to a positive time.
|
|
221
|
+
* @remarks
|
|
222
|
+
* Use this after engineering has moved a burst stat: a recipe that gives a weapon a
|
|
223
|
+
* two-round burst changes the rate of fire without naming it. `weaponMetrics` takes
|
|
224
|
+
* `rateOfFire` as given, so recompute it first if you have changed the parts.
|
|
225
|
+
* @example
|
|
226
|
+
* ```ts
|
|
227
|
+
* import { combinedRateOfFire } from '@elite-dangerous-almanac/core/ships/weapons';
|
|
228
|
+
*
|
|
229
|
+
* // A small burst laser: three shots at 15/s, then half a second's wait
|
|
230
|
+
* combinedRateOfFire({ burstInterval: 0.5, burstRounds: 3, burstRateOfFire: 15 }); // -> 4.74
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
233
|
+
declare function combinedRateOfFire(weapon: WeaponStats): number | undefined;
|
|
234
|
+
/**
|
|
235
|
+
* Split a per-second (or per-shot) damage figure by damage type.
|
|
236
|
+
*
|
|
237
|
+
* @param damage - The figure to split — DPS, sustained DPS, damage per shot, anything.
|
|
238
|
+
* @param distribution - The weapon's damage distribution. Absent treats the whole
|
|
239
|
+
* figure as absolute damage, which no resistance reduces.
|
|
240
|
+
* @returns The share of `damage` in each type. `antiXeno` overlays conventional damage
|
|
241
|
+
* rather than partitioning it; the other returned amounts sum back to `damage`.
|
|
242
|
+
* @example
|
|
243
|
+
* ```ts
|
|
244
|
+
* import { splitDamage } from '@elite-dangerous-almanac/core/ships/weapons';
|
|
245
|
+
*
|
|
246
|
+
* splitDamage(60, { kinetic: 1 / 3, thermal: 2 / 3 }); // -> { kinetic: 20, thermal: 40, ... }
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
249
|
+
declare function splitDamage(damage: number, distribution?: DamageDistribution): DamageSplit;
|
|
250
|
+
/**
|
|
251
|
+
* The factor that turns a weapon's while-firing figures into sustained ones — the
|
|
252
|
+
* share of the time it spends shooting rather than reloading.
|
|
253
|
+
*
|
|
254
|
+
* @param weapon - The weapon's stats.
|
|
255
|
+
* @returns A factor in `(0, 1]`: `1` for anything that never stops to reload, less for
|
|
256
|
+
* a weapon whose clip runs dry. A fractional clip is held to whole rounds, rounding **up**
|
|
257
|
+
* — which only a hand-built or journal-stated figure can be, since an engineered clip is
|
|
258
|
+
* rounded to a whole *burst* where the roll is computed (`./engineering`). On a burst
|
|
259
|
+
* weapon the two rules can differ by a round: a reload cycle follows Coriolis's own
|
|
260
|
+
* `getClip` end to end, so taking half of EDSY's rule into it would agree with neither.
|
|
261
|
+
* @remarks
|
|
262
|
+
* A clip's worth of fire takes `(clip − burst) / rateOfFire` seconds plus the time to
|
|
263
|
+
* finish the last burst, then the reload; the sustained rate is the clip divided by
|
|
264
|
+
* that whole cycle.
|
|
265
|
+
* @example
|
|
266
|
+
* ```ts
|
|
267
|
+
* import { sustainedFireFactor } from '@elite-dangerous-almanac/core/ships/weapons';
|
|
268
|
+
*
|
|
269
|
+
* // A small multi-cannon: 100 rounds at 7.69/s, then a 4 s reload
|
|
270
|
+
* sustainedFireFactor({ rateOfFire: 7.692308, clipSize: 100, reloadTime: 4 }); // -> 0.77…
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
declare function sustainedFireFactor(weapon: WeaponStats): number;
|
|
274
|
+
/**
|
|
275
|
+
* Damage per second while the trigger is held, reloads ignored.
|
|
276
|
+
*
|
|
277
|
+
* @param weapon - The weapon's stats.
|
|
278
|
+
* @returns Damage per second. A continuous-fire weapon (no `rateOfFire`) reports its
|
|
279
|
+
* `damage` unchanged, because that stat is already per second.
|
|
280
|
+
*/
|
|
281
|
+
declare function damagePerSecond(weapon: WeaponStats): number;
|
|
282
|
+
/**
|
|
283
|
+
* Damage per second averaged over reloads — what a long engagement actually sees.
|
|
284
|
+
*
|
|
285
|
+
* @param weapon - The weapon's stats.
|
|
286
|
+
* @returns Sustained damage per second.
|
|
287
|
+
*/
|
|
288
|
+
declare function sustainedDamagePerSecond(weapon: WeaponStats): number;
|
|
289
|
+
/**
|
|
290
|
+
* Weapons-capacitor draw per second, in megawatts.
|
|
291
|
+
*
|
|
292
|
+
* @param weapon - The weapon's stats.
|
|
293
|
+
* @returns Capacitor draw per second, reloads ignored. Compare against the power
|
|
294
|
+
* distributor's `weaponsRecharge` to see whether the build can fire indefinitely.
|
|
295
|
+
*/
|
|
296
|
+
declare function energyPerSecond(weapon: WeaponStats): number;
|
|
297
|
+
/**
|
|
298
|
+
* Heat generated per second.
|
|
299
|
+
*
|
|
300
|
+
* @param weapon - The weapon's stats.
|
|
301
|
+
* @returns Heat per second, reloads ignored.
|
|
302
|
+
*/
|
|
303
|
+
declare function heatPerSecond(weapon: WeaponStats): number;
|
|
304
|
+
/**
|
|
305
|
+
* How much of a weapon's damage still lands at a given range.
|
|
306
|
+
*
|
|
307
|
+
* @param weapon - The weapon's stats.
|
|
308
|
+
* @param metres - The range to the target, in metres.
|
|
309
|
+
* @returns A factor in `[0, 1]`: `1` inside the falloff range, tapering linearly to
|
|
310
|
+
* `0` at maximum range and staying there beyond it. A weapon with no falloff data
|
|
311
|
+
* reports `1` up to its maximum range. Projectile boundary parameters are deliberately
|
|
312
|
+
* ignored: this function calculates attenuation, not projectile reach.
|
|
313
|
+
* @example
|
|
314
|
+
* ```ts
|
|
315
|
+
* import { damageFalloff } from '@elite-dangerous-almanac/core/ships/weapons';
|
|
316
|
+
*
|
|
317
|
+
* const mc = { maximumRange: 4000, falloffRange: 2000 };
|
|
318
|
+
* damageFalloff(mc, 1500); // -> 1
|
|
319
|
+
* damageFalloff(mc, 3000); // -> 0.5
|
|
320
|
+
* damageFalloff(mc, 5000); // -> 0
|
|
321
|
+
* ```
|
|
322
|
+
*/
|
|
323
|
+
declare function damageFalloff(weapon: WeaponStats, metres: number): number;
|
|
324
|
+
/**
|
|
325
|
+
* How much of a weapon's damage a hull's hardness lets through.
|
|
326
|
+
*
|
|
327
|
+
* @param armourPiercing - The weapon's piercing rating.
|
|
328
|
+
* @param hardness - The target hull's finite, non-negative {@link Ship.hardness}.
|
|
329
|
+
* Pass `0` when the hardness is unknown, which disables hardness scaling.
|
|
330
|
+
* @returns A factor in `[0, 1]`: `1` when the weapon out-pierces the hull, otherwise
|
|
331
|
+
* `armourPiercing / hardness`. A zero piercing rating returns `0` when hardness is
|
|
332
|
+
* positive; zero hardness always returns `1` because it disables hardness scaling.
|
|
333
|
+
* Applies to hull damage only — shields do not care.
|
|
334
|
+
* @throws {RangeError} If either argument is not a finite non-negative number.
|
|
335
|
+
* @example
|
|
336
|
+
* ```ts
|
|
337
|
+
* import { armourPiercingFactor } from '@elite-dangerous-almanac/core/ships/weapons';
|
|
338
|
+
*
|
|
339
|
+
* armourPiercingFactor(22, 65); // -> 0.338… a small multi-cannon against an Anaconda
|
|
340
|
+
* armourPiercingFactor(100, 65); // -> 1 a rail gun goes straight through
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
343
|
+
declare function armourPiercingFactor(armourPiercing: number, hardness: number): number;
|
|
344
|
+
/**
|
|
345
|
+
* Everything an outfitting screen shows about one weapon: DPS, sustained DPS, the
|
|
346
|
+
* capacitor and heat cost of firing it, and the damage split by type.
|
|
347
|
+
*
|
|
348
|
+
* @param weapon - The weapon's stats, post-engineering. A catalogue record works as-is.
|
|
349
|
+
* @returns The {@link WeaponMetrics}.
|
|
350
|
+
* @example
|
|
351
|
+
* ```ts
|
|
352
|
+
* import { getModuleBySymbol } from '@elite-dangerous-almanac/core/ships/modules';
|
|
353
|
+
* import { HARDPOINT_MODULES } from '@elite-dangerous-almanac/core/ships/modules-hardpoint';
|
|
354
|
+
* import { weaponMetrics } from '@elite-dangerous-almanac/core/ships/weapons';
|
|
355
|
+
*
|
|
356
|
+
* const beam = weaponMetrics(getModuleBySymbol('Hpt_BeamLaser_Fixed_Small', HARDPOINT_MODULES)!);
|
|
357
|
+
* beam.continuous; // -> true
|
|
358
|
+
* beam.damagePerSecond; // -> 9.8 (its `damage` is already per second)
|
|
359
|
+
* beam.damageByType.thermal; // -> 9.8
|
|
360
|
+
* ```
|
|
361
|
+
*/
|
|
362
|
+
declare function weaponMetrics(weapon: WeaponStats): WeaponMetrics;
|
|
363
|
+
/**
|
|
364
|
+
* Add several weapons' metrics together — a build's total firepower.
|
|
365
|
+
*
|
|
366
|
+
* @param metrics - The per-weapon metrics to sum.
|
|
367
|
+
* @returns The additive {@link WeaponTotals}. An empty list returns zeroes.
|
|
368
|
+
* @example
|
|
369
|
+
* ```ts
|
|
370
|
+
* import type { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
|
|
371
|
+
* import { sumWeaponMetrics } from '@elite-dangerous-almanac/core/ships/weapons';
|
|
372
|
+
*
|
|
373
|
+
* declare const build: ShipLoadout;
|
|
374
|
+
*
|
|
375
|
+
* sumWeaponMetrics(build.weaponMetrics().weapons.map((w) => w.metrics)).damagePerSecond;
|
|
376
|
+
* ```
|
|
377
|
+
*/
|
|
378
|
+
declare function sumWeaponMetrics(metrics: readonly WeaponMetrics[]): WeaponTotals;
|
|
379
|
+
|
|
380
|
+
export { type DamageSplit, type WeaponMetrics, type WeaponStats, type WeaponTotals, armourPiercingFactor, combinedRateOfFire, damageFalloff, damagePerSecond, energyPerSecond, heatPerSecond, splitDamage, sumWeaponMetrics, sustainedDamagePerSecond, sustainedFireFactor, weaponMetrics };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{armourPiercingFactor,combinedRateOfFire,damageFalloff,damagePerSecond,energyPerSecond,heatPerSecond,splitDamage,sumWeaponMetrics,sustainedDamagePerSecond,sustainedFireFactor,weaponMetrics}from"../chunk-INNFH37U.js";//# sourceMappingURL=weapons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"O"}
|