mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Merge branch 'feature/x' into develop
This commit is contained in:
@@ -86,19 +86,13 @@ export default class EngineProfile extends TranslatedComponent {
|
||||
|
||||
// Calculate bounds for our line chart
|
||||
const thrusters = ship.standard[1].m;
|
||||
const minMass = thrusters.getMinMass();
|
||||
const minMass = ship.calcLowestPossibleMass({ th: thrusters });
|
||||
const maxMass = thrusters.getMaxMass();
|
||||
let mass = ship.unladenMass + ship.fuelCapacity + cargo;
|
||||
const minSpeed = Calc.speed(maxMass, ship.speed, thrusters, ship.engpip)[4];
|
||||
const maxSpeed = Calc.speed(minMass, ship.speed, thrusters, ship.engpip)[4];
|
||||
let mass = ship.unladenMass + ship.fuelCapacity + cargo;
|
||||
let mark;
|
||||
if (mass < minMass) {
|
||||
mark = minMass;
|
||||
} else if (mass > maxMass) {
|
||||
mark = maxMass;
|
||||
} else {
|
||||
mark = mass;
|
||||
}
|
||||
// Add a mark at our current mass
|
||||
const mark = Math.min(mass, maxMass);
|
||||
|
||||
const cargoPercent = cargo / ship.cargoCapacity;
|
||||
|
||||
|
||||
@@ -88,19 +88,13 @@ export default class FSDProfile extends TranslatedComponent {
|
||||
// Calculate bounds for our line chart - use thruster info for X
|
||||
const thrusters = ship.standard[1].m;
|
||||
const fsd = ship.standard[2].m;
|
||||
const minMass = thrusters.getMinMass();
|
||||
const minMass = ship.calcLowestPossibleMass({ th: thrusters });
|
||||
const maxMass = thrusters.getMaxMass();
|
||||
const minRange = 0;
|
||||
let mass = ship.unladenMass + ship.fuelCapacity + cargo;
|
||||
const minRange = Calc.jumpRange(maxMass, fsd, ship.fuelCapacity);
|
||||
const maxRange = Calc.jumpRange(minMass + fsd.getMaxFuelPerJump(), fsd, fsd.getMaxFuelPerJump());
|
||||
let mass = ship.unladenMass + fsd.getMaxFuelPerJump() + cargo;
|
||||
let mark;
|
||||
if (mass < minMass) {
|
||||
mark = minMass;
|
||||
} else if (mass > maxMass) {
|
||||
mark = maxMass;
|
||||
} else {
|
||||
mark = mass;
|
||||
}
|
||||
// Add a mark at our current mass
|
||||
const mark = Math.min(mass, maxMass);
|
||||
|
||||
const cargoPercent = cargo / ship.cargoCapacity;
|
||||
|
||||
|
||||
@@ -282,10 +282,10 @@ The retrofit costs provides information about the costs of changing the base bui
|
||||
The reload costs provides information about the costs of reloading your current build.</p>
|
||||
|
||||
<h2>Engine Profile</h2>
|
||||
The engine profile panel provides information about the capabilities of your current thrusters. The graph shows you how the maximum speed (with 4 pips to engines) alters with the overall mass of your build. The slider can be altered to change the amount of cargo you have on-board. Your engine profile can be altered by obtaining different thrusters or engineering your existing thrusters.</p>
|
||||
The engine profile panel provides information about the capabilities of your current thrusters. The graph shows you how the maximum speed (with a full fuel tank and 4 pips to engines) alters with the overall mass of your build. The slider can be altered to change the amount of cargo you have on-board. Your engine profile can be altered by obtaining different thrusters or engineering your existing thrusters.</p>
|
||||
|
||||
<h2>FSD Profile</h2>
|
||||
The FSD profile panel provides information about the capabilities of your current frame shift drive. The graph shows you how the maximum jump range alters with the overall mass of your build. The slider can be altered to change the amount of cargo you have on-board. Your FSD profile can be altered by obtaining a different FSD or engineering your existing FSD.</p>
|
||||
The FSD profile panel provides information about the capabilities of your current frame shift drive. The graph shows you how the maximum jump range (with a full fuel tank) alters with the overall mass of your build. The slider can be altered to change the amount of cargo you have on-board. Your FSD profile can be altered by obtaining a different FSD or engineering your existing FSD.</p>
|
||||
|
||||
<h2>Jump Range</h2>
|
||||
The jump range panel provides information about the build' jump range. The graph shows how the build's jump range changes with the amount of cargo on-board. The slider can be altered to change the amount of fuel you have on-board.</p>
|
||||
|
||||
@@ -1682,6 +1682,25 @@ export default class Ship {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the lowest possible mass for this ship.
|
||||
* @param {Object} m Module override set (standard type => Module)
|
||||
* @return {number} The lowest possible mass for this ship
|
||||
*/
|
||||
calcLowestPossibleMass(m) {
|
||||
m = m || {};
|
||||
|
||||
let mass = this.hullMass;
|
||||
mass += m.pp ? m.pp.getMass() : ModuleUtils.standard(0, '2D').getMass();
|
||||
mass += m.th ? m.th.getMass() : ModuleUtils.standard(1, '2D').getMass();
|
||||
mass += m.fsd ? m.fsd.getMass() : ModuleUtils.standard(2, this.standard[2].maxClass + 'D').getMass();
|
||||
mass += m.ls ? m.ls.getMass() : ModuleUtils.standard(3, this.standard[3].maxClass + 'D').getMass() * 0.3; // Lightweight grade 4 mod reduces mass by up to 70%
|
||||
mass += m.pd ? m.pd.getMass() : ModuleUtils.standard(4, '2D').getMass();
|
||||
mass += m.s ? m.s.getMass() : ModuleUtils.standard(5, this.standard[5].maxClass + 'D').getMass();
|
||||
mass += m.ft ? m.ft.getMass() : ModuleUtils.standard(6, '1C').getMass();
|
||||
return mass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the lightest standard ModuleUtils unless otherwise specified
|
||||
* @param {Object} m Module override set (standard type => module ID)
|
||||
|
||||
Reference in New Issue
Block a user