DotNet.Ships.Class.Weapons - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

EliteDangerousAlmanac / Ships / Weapons

Class: Weapons

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Weapons.cs:243

Damage per second, capacitor draw per second, heat per second, and how the damage splits by type.

Remarks

A weapon's catalogue record gives damage per round. Turning that into damage per second means folding in the rounds per shot and the rate of fire, and, for the sustained figures, the clip and the reload, because a weapon that stops to reload is not firing.

Beam and mining lasers are continuous. They carry no rate of fire, and their damage, draw and thermal load are already per second, so the per-second figures collapse to the raw stats.

Reference implementation: EDCD/Coriolis, src/app/shipyard/Module.js, cross-checked against EDSY. The algorithm is ported as fact rather than as code. See ATTRIBUTIONS.md for credit and licence terms.

Methods

ArmourPiercingFactor()

static ArmourPiercingFactor(armourPiercing, hardness): double

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Weapons.cs:432

How much of a weapon's damage a hull's hardness lets through.

Parameters

armourPiercing

double

The weapon's piercing rating.

hardness

double

The target hull's hardness. No hardness disables the scaling, which is what to pass where the hardness is unknown.

Returns

double

A factor from zero through one: the whole of it where the weapon out-pierces the hull, and the piercing over the hardness otherwise. No hardness always answers the whole of it, because it disables the scaling.

Remarks

This applies to hull damage alone. Shields do not care.

Exceptions

ArgumentOutOfRangeException

An argument is not a finite number of zero or more.

CombinedRateOfFire()

static CombinedRateOfFire(weapon): double?

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Weapons.cs:293

The combined rate of fire a weapon's firing cycle implies, which is the journal's own rate rebuilt from its parts.

Parameters

weapon

WeaponStats

The weapon's stats, post-engineering.

Returns

double?

The shots per second, or null for a continuous-fire weapon, or for a cycle that does not resolve to a time above zero.

Remarks

A cycle fires its burst rounds a burst rate apart, then waits out the burst interval before the next one. A charge time is the delay before a shot lands, and not part of the cadence Frontier reports.

The cycle is rebuilt the way the game builds it, a float stored after every operation and then written to six decimal places, so the answer is the figure the game reports rather than one a little beside it. Use it for parts changed by hand: a recipe that gives a weapon a two-round burst changes the rate of fire without naming it. A weapon read from a build needs no recomputation, because its rate is already this figure.

Exceptions

ArgumentNullException

weapon is null.

DamageFalloff()

static DamageFalloff(weapon, metres): double

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Weapons.cs:400

How much of a weapon's damage still lands at a given range.

Parameters

weapon

WeaponStats

The weapon's stats.

metres

double

The range to the target, in metres.

Returns

double

A factor from zero through one: the whole of it inside the falloff range, tapering to nothing at the largest range and staying there beyond it. A weapon with no falloff data reports the whole of it up to its largest range.

Remarks

The projectile boundary parameters are deliberately ignored: this is attenuation, not projectile reach.

Exceptions

ArgumentNullException

weapon is null.

DamagePerSecond()

static DamagePerSecond(weapon): double

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Weapons.cs:347

The damage per second while the trigger is held, reloads ignored.

Parameters

weapon

WeaponStats

The weapon's stats.

Returns

double

The damage per second. A continuous-fire weapon reports its damage unchanged, because that stat is already per second.

Exceptions

ArgumentNullException

weapon is null.

EnergyPerSecond()

static EnergyPerSecond(weapon): double

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Weapons.cs:369

The weapons-capacitor draw per second, in megawatts.

Parameters

weapon

WeaponStats

The weapon's stats.

Returns

double

The capacitor draw per second, reloads ignored. For firing endurance, use WeaponsCapacitor.Metrics, which compares the pip-scaled recharge with the sustained draw rather than this burst rate.

Exceptions

ArgumentNullException

weapon is null.

HeatPerSecond()

static HeatPerSecond(weapon): double

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Weapons.cs:380

The heat generated per second.

Parameters

weapon

WeaponStats

The weapon's stats.

Returns

double

The heat per second, reloads ignored.

Exceptions

ArgumentNullException

weapon is null.

Metrics()

static Metrics(weapon): WeaponMetrics

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Weapons.cs:448

Everything an outfitting screen shows about one weapon: the damage per second, the sustained damage per second, the capacitor and heat cost of firing it, and the damage split by type.

Parameters

weapon

WeaponStats

The weapon's stats, post-engineering.

Returns

WeaponMetrics

The weapon's metrics.

Exceptions

ArgumentNullException

weapon is null.

SplitDamage()

static SplitDamage(damage, distribution): DamageSplit

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Weapons.cs:255

Splits a per-second or per-shot damage figure by damage type.

Parameters

damage

double

The figure to split.

distribution

DamageDistribution?

The weapon's damage distribution. An absent one treats the whole figure as absolute damage, which no resistance reduces.

Returns

DamageSplit

The share of the damage in each type. The anti-xeno share overlays conventional damage rather than partitioning it, and the other shares sum back to the figure.

Sum()

static Sum(metrics): WeaponTotals

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Weapons.cs:481

Adds several weapons' metrics together, for a build's total firepower.

Parameters

metrics

IReadOnlyList<WeaponMetrics>

The per-weapon metrics to sum.

Returns

WeaponTotals

The additive totals. An empty list answers no firepower at all.

Exceptions

ArgumentNullException

metrics is null.

SustainedDamagePerSecond()

static SustainedDamagePerSecond(weapon): double

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Weapons.cs:358

The damage per second averaged over reloads, which a long engagement sees.

Parameters

weapon

WeaponStats

The weapon's stats.

Returns

double

The sustained damage per second.

Exceptions

ArgumentNullException

weapon is null.

SustainedFireFactor()

static SustainedFireFactor(weapon): double

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Weapons.cs:321

The factor that turns a weapon's while-firing figures into sustained ones: the share of the time it spends shooting rather than reloading.

Parameters

weapon

WeaponStats

The weapon's stats.

Returns

double

A factor above zero and at most one. It is one for anything that never stops to reload, and less for a weapon whose clip runs dry.

Remarks

A clip's worth of fire takes the rounds after the first burst at the rate of fire, plus the time to finish the last burst, and then the reload. The sustained rate is the clip divided by that whole cycle. A part clip is held to whole rounds, rounding up, which only a hand-built or journal-stated figure can be: an engineered clip is rounded to a whole burst where the roll is computed.

Exceptions

ArgumentNullException

weapon is null.

⚠️ **GitHub.com Fallback** ⚠️