-
Notifications
You must be signed in to change notification settings - Fork 0
ships.Function.resolveBlueprintForModule
@elite-dangerous-almanac/core / ships / resolveBlueprintForModule
resolveBlueprintForModule(
symbol,fdname):string
Defined in: src/ships/blueprint-journal.ts:119
The blueprint whose numbers a module actually rolls when a journal names blueprint on
it — the same id back, except where the game spells two different recipes alike.
One BlueprintName, two recipes. Long Range and Wide Angle are offered on the
internal sensor suite and on the KWS/manifest/wake scanners, and the game writes the
same id for both families. The two roll different stats, in opposite directions:
| On a sensor suite | On a utility scanner |
|---|---|
Long Range: Mass ×1.20, ScannerRange +0…15% |
Long Range: PowerDraw ×1.10, ScannerRange +0…24% |
Wide Angle: PowerDraw ×1.10, ScannerRange −4% |
Wide Angle: Mass ×1.20, ScannerTimeToScan +10% |
(Grade 1 shown; both pairs share their SensorTargetScanAngle leg.) BLUEPRINTS keys
the scanner side under Scanner_LongRange / Scanner_WideAngle, which is the spelling
the scanner menus list — so on a scanner this resolves Sensor_LongRange to
Scanner_LongRange, and folding the id as written would charge the build mass where the
game charges power draw.
One BlueprintName, two recipes — again, on the multi-cannons. The game writes
Weapon_Overcharged for every weapon's Overcharged, but a multi-cannon's also cuts the
clip — 3% at grade 1 falling to 15% at grade 5 — which the recipe the other weapons take
does not. BLUEPRINTS keys the multi-cannon side under MC_Overcharged, the spelling
the multi-cannon menus list, so on a multi-cannon this resolves Weapon_Overcharged to
MC_Overcharged and folding the id as written would report a clip the build does not
have. This is the common case of the three: 70 of the build corpus's 1902 declared
entries go through it, against one for the scanners.
The clip penalty is folded only when a module's engineering menu offers the
multi-cannon recipe. Anti-xeno multi-cannons have no ordinary engineering menu, so
their journal id stays unchanged. Cannons, fragment cannons and plasma accelerators
take no clip leg either: journal captures of a large gimballed cannon at grade 5, of a
medium fragment cannon at grade 4 and of a medium plasma accelerator at grade 1, each
rolled under this id, report no AmmoClipSize modifier. See
data/ships/SOURCES.md
§ "Multi-cannon Overcharged" for the captures.
The pairing is global, not repeated per menu. A purpose-specific catalogue maps each of the three recipe ids to the colliding id the journal writes. This function supplies the half only a menu knows, by asking which mapped recipe this module is offered. Keeping one global map avoids repeating aliases on every scanner or multi-cannon group and silently forgetting the next one.
Only the module can settle it, which is why this takes one. It resolves into a menu
and never out of one: a sensor suite's Sensor_LongRange is already its own menu's id
and comes back unchanged, and asking for Scanner_LongRange on a sensor suite returns
it unchanged too — unchanged is not the same as offered, and getBlueprintsForModule
still says a suite does not take it.
Only the numbers differ, not the price. All three pairs cost the same materials at
every grade, so getBlueprintCost from ships/blueprint-costs needs no module and
either spelling bills correctly; cross-catalogue tests hold upstream to that. It is the
stat block that has to be resolved.
Not a generic-spelling resolver. A generic Misc_* id — Misc_Shielded where a
life support's menu says LifeSupport_Shielded — comes back as it went in. That pair is
one recipe under two spellings, both published with their own numbers, so the id a
caller names is the one to roll. This function exists for the case where the id names no
recipe the module has: the game never rolls a sensor suite's Long Range on a scanner.
string
A module symbol, e.g. "Hpt_CloudScanner_Size0_Class5".
string
A blueprint catalogue or journal id, matched case-insensitively and
trimmed. Colliding journal spellings are resolved against symbol.
string
The id to join to BLUEPRINTS, in that catalogue's spelling when a journal
name resolved, and otherwise fdname exactly as it was passed — byte for byte, so a
caller who never meets the collision never sees their own spelling rewritten.
If fdname is not a string, including when it is missing — this
returns an id rather than reporting whether one is known, so there is no miss for a
nullish one to be. A nullish symbol is a miss: an unknown module offers no menu,
and fdname comes back unchanged.
import { resolveBlueprintForModule } from '@elite-dangerous-almanac/core/ships/blueprint-journal';
// A wake scanner's Long Range is the scanner recipe, whichever way the build spells it.
resolveBlueprintForModule('Hpt_CloudScanner_Size0_Class5', 'Sensor_LongRange');
// -> 'Scanner_LongRange'
resolveBlueprintForModule('Hpt_CloudScanner_Size0_Class5', 'Scanner_LongRange');
// -> 'Scanner_LongRange'
// The sensor suite keeps its own, and every other module keeps whatever it was given.
resolveBlueprintForModule('Int_Sensors_Size4_Class5', 'Sensor_LongRange');
// -> 'Sensor_LongRange'
resolveBlueprintForModule('Int_Hyperdrive_Size5_Class5', 'FSD_LongRange');
// -> 'FSD_LongRange'
// A multi-cannon's Overcharged is the multi-cannon recipe, clip penalty and all.
resolveBlueprintForModule('Hpt_MultiCannon_Fixed_Medium', 'Weapon_Overcharged');
// -> 'MC_Overcharged'
resolveBlueprintForModule('Hpt_BeamLaser_Fixed_Small', 'Weapon_Overcharged');
// -> 'Weapon_Overcharged'Guides
astro
Classes (1)
ProceduralSystem
Properties
Accessors
Methods
Interfaces (16)
Type Aliases (3)
Variables (11)
Functions (37)
- absoluteBoxelToBoxelCode
- boxelCodeToAbsoluteBoxel
- boxelCodeToLetters
- boxelEdgeLy
- boxelInternalSize
- canonicalizeSectorName
- canonicalizeSystemName
- decodeModSystemAddress
- decodeSystemAddress
- encodeModSystemAddress
- encodeSystemAddress
- findHandAuthoredRegionAt
- formatSystemName
- getCodexRegion
- getCodexRegionByName
- getHandAuthoredRegionOrigin
- getNebulaByName
- isPermitLockedRegionName
- isPermitLockedSystemName
- isProceduralSystemName
- lettersToBoxelCode
- massCodeToSizeClass
- nearestNebulae
- nebulaeWithin
- parseSystemName
- permitLockedRegionForSystemName
- permitLockedSystemForAddress
- permitLockedSystemForName
- permitLockForSystemName
- resolveNamingRegionOrigin
- sectorGridPositionFromGalacticPosition
- sectorGridPositionFromName
- sectorNameFromGalacticPosition
- sectorNameFromGridPosition
- sizeClassToMassCode
- toSystemAddress
- tryToSystemAddress
commodities
Interfaces (1)
Type Aliases (1)
Variables (3)
Functions (3)
equipment
Interfaces (6)
Type Aliases (8)
Variables (3)
Functions (10)
Subpath modules (2)
i18n
Interfaces (1)
Type Aliases (1)
Functions (17)
- getBlueprintName
- getCalculationIssueMessage
- getEngineeringGroupName
- getExperimentalEffectDescription
- getExperimentalEffectName
- getLoadoutEditErrorMessage
- getLoadoutIssueMessage
- getLoadoutSlotName
- getMaterialName
- getMicroResourceName
- getModuleName
- getOutfittingFamilyName
- getPreEngineeredVariantName
- getShipManufacturer
- getShipName
- getSlefDiagnosticMessage
- getSlotRestrictionLabel
materials
Enumerations (2)
Interfaces (2)
Type Aliases (2)
Variables (9)
ships
Classes (3)
BuildMetrics
Methods
- armourMetrics()
- buildCost()
- buildMass()
- cellBanks()
- distributorMetrics()
- distributorMetricsResult()
- frameShiftDrive()
- frameShiftDriveMassFactor()
- fuelPerJump()
- heatMetrics()
- heatMetricsResult()
- jumpRange()
- jumpRangeSummary()
- ladenJumpRange()
- loadout()
- maxJumpRange()
- mobilityCapacitorMetrics()
- mobilityCapacitorMetricsResult()
- mobilityMetrics()
- mobilityMetricsResult()
- powerBudget()
- shieldCapacitorMetrics()
- shieldCapacitorMetricsResult()
- shieldMetrics()
- shieldMetricsResult()
- shieldRecovery()
- shieldRecoveryResult()
- standardLoad()
- standardLoadResult()
- thrusters()
- totalRange()
- weaponMetrics()
- weaponsCapacitorMetrics()
- of()
LoadoutEditError
Constructors
Properties
Methods
ShipLoadout
Accessors
- cargoCapacity
- fuelCapacity
- hullValue
- importOutcomes
- modulesValue
- rebuy
- shipIdent
- shipName
- shipSymbol
- sourcePurchase
- unladenMass
Methods
- applyBlueprint()
- availableBlueprints()
- availableExperimentalEffects()
- clearEngineering()
- completeEngineeringGrade()
- fittedModuleAt()
- fittedModules()
- modulesForSlot()
- removeModule()
- repairFixedMount()
- setExperimentalEffect()
- setModule()
- setModuleEnabled()
- setModulePriority()
- setPreEngineeredVariant()
- slots()
- toLoadoutEvent()
- toSlef()
- toSlefString()
- validation()
- default()
- empty()
- fromLoadout()
- fromSlef()
Interfaces (125)
- AmmunitionCapacity
- AmmunitionStats
- ApplyBlueprintOptions
- ArmourInput
- ArmourMetrics
- AvailableBlueprint
- Blueprint
- BlueprintFeature
- BlueprintGrade
- BlueprintModuleEngineering
- BuildCost
- BuildCredits
- BuildMass
- BuildSlotBase
- BuildWeaponMetrics
- BulkheadParams
- CalculationIssue
- CellBankInput
- CellBankMetrics
- CellBankSummary
- CoreBuildSlot
- CoreSlots
- DamageComponents
- DamageDistribution
- DamageResistanceParams
- DamageSplit
- DamageTypeValues
- DistributorCapacitorMetrics
- DistributorInput
- DistributorMetrics
- DistributorOptions
- DistributorPips
- EngineeringMaterial
- EngineeringModifier
- EngineeringNormalizationUnchanged
- EngineeringNormalizationUnsupported
- EngineeringNormalized
- EngineeringOptionGroup
- ExperimentalContribution
- ExperimentalEffect
- ExperimentalEffectUnchanged
- ExperimentalEffectUnsupported
- ExperimentalEffectUpdated
- FittedModule
- FittedWeaponMetrics
- FrameShiftDriveJumpStats
- FrameShiftDriveParams
- FuelCapacity
- GunsightPoint
- HardpointBuildSlot
- HardpointSlotSpec
- HeatInput
- HeatMetrics
- HeatState
- HeatWeapon
- HullReinforcementParams
- JumpOptions
- JumpRangeSummary
- LoadoutCalculationModule
- LoadoutEvent
- LoadoutExportOptions
- LoadoutIssue
- LoadoutMass
- LoadoutModule
- LoadoutValidation
- LoadoutValidationInput
- MassCurveStats
- MobilityCapacitorInput
- MobilityCapacitorMetrics
- MobilityCapacitorOptions
- MobilityInput
- MobilityMetrics
- ModuleLimitEntry
- ModuleLimitIncrease
- ModuleLimitUsage
- ModuleReinforcementParams
- OptionalBuildSlot
- OptionalSlotSpec
- OutfittingModule
- OutfittingModuleIdentity
- OutfittingModuleStats
- ParsedSlot
- PowerBand
- PowerBudget
- PowerConsumer
- PowerConsumerResult
- PowerDistributorStats
- PowerGenerationStats
- PreEngineeredModifier
- PreEngineeredVariant
- ProjectileRangeBoundaries
- ShieldBoosterParams
- ShieldCapacitorInput
- ShieldCapacitorMetrics
- ShieldCapacitorOptions
- ShieldGeneratorParams
- ShieldInput
- ShieldMetrics
- ShieldRecovery
- ShieldRecoveryInput
- ShieldRecoveryOptions
- ShieldRegenerationStats
- Ship
- ShipSlots
- SimpleBuildSlot
- SlefDiagnostic
- SlefEntry
- SlefExportOptions
- SlefHeader
- SlefInspection
- SlefStringifyOptions
- SourceModuleValue
- SourcePurchaseRecord
- StandardLoadInputs
- ThrusterCurveParams
- ThrusterParams
- TotalRangeDetails
- ValidationModule
- WeaponDamageStats
- WeaponMetrics
- WeaponsCapacitorInput
- WeaponsCapacitorMetrics
- WeaponsOptions
- WeaponStats
- WeaponTotals
Type Aliases (44)
- BlueprintGrades
- BuildSlot
- CalculationIssueReason
- CalculationResult
- CoreSlotType
- DamageResistances
- DamageType
- EngineeringGroupId
- EngineeringNormalizationCode
- EngineeringNormalizationResult
- ExperimentalEffectMutationCode
- ExperimentalEffectMutationResult
- FixedMountRepairResult
- GunsightOffset
- HardpointRestriction
- ImmovableReason
- LoadoutEditErrorCode
- LoadoutImportOutcome
- LoadoutIssueCode
- LoadoutIssueParam
- LoadoutIssueParams
- LoadoutSlot
- ModifierMethod
- ModuleCategory
- ModuleEngineering
- ModuleExclusionGroup
- ModuleFitConstraint
- ModuleGuidance
- ModuleLimitGroup
- ModuleMount
- ModuleRating
- ModuleSlot
- OptionalRestriction
- OutfittingFamilyId
- PreEngineeredAcquisition
- ShipGunsight
- ShipGunsightCatalogue
- Slef
- SlefConstraint
- SlefDiagnosticCode
- SlotKind
- SlotRestriction
- StandardLoad
- ThrusterLoad
Variables (10)
Functions (85)
- ammunitionCapacity
- armourMetrics
- armourPiercingFactor
- calculateCargoCapacity
- calculateFuelCapacity
- calculateModuleLimits
- calculateUnladenMass
- cellBankSummary
- combinedRateOfFire
- computeModifiers
- damageFalloff
- damagePerSecond
- distributorMetrics
- effectiveHitPoints
- effectiveWeaponThermalLoad
- energyPerSecond
- enumerateSlots
- equilibriumHeatLevel
- frameShiftDriveMassFactor
- fuelPerJump
- getBlueprint
- getBlueprintGrade
- getBlueprintsForModule
- getBulkheadsForShip
- getEngineeringGroup
- getExperimentalEffect
- getExperimentalsForBlueprint
- getExperimentalsForModule
- getLoadoutModifier
- getModuleBySymbol
- getModulesByName
- getPreEngineeredJournalModifiers
- getPreEngineeredModifiers
- getPreEngineeredStats
- getPreEngineeredVariants
- getShipByName
- getShipBySymbol
- getShipGunsight
- getShipSlots
- getSourceModuleValue
- hasFrameShiftDriveJumpStats
- hasMassCurveStats
- hasPowerDistributorStats
- hasPowerGenerationStats
- hasShieldRegenerationStats
- hasWeaponDamageStats
- heatLevelAtTime
- heatMetrics
- heatPerSecond
- identifyPreEngineeredVariant
- inspectSlef
- isPreEngineered
- mapDamageTypes
- mobilityCapacitorMetrics
- mobilityMetrics
- parseSlef
- parseSlotName
- powerBudget
- projectGunsight
- resolveBlueprintForModule
- secondsToHeatLevel
- shieldCapacitorMetrics
- shieldMassCurveMultiplier
- shieldMetrics
- shieldRecovery
- shieldStrength
- singleJumpRange
- sourcePurchaseFromLoadout
- splitDamage
- stackArmourResistance
- stackShieldResistance
- stringifySlef
- sumMaterials
- sumSourceModuleValues
- sumWeaponMetrics
- sustainedDamagePerSecond
- sustainedFireFactor
- systemsResistance
- thrusterMassCurveMultiplier
- toSlef
- totalRange
- unresolvedModifiers
- validateLoadout
- weaponMetrics
- weaponsCapacitorMetrics