mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff25b55c1f | ||
|
|
ae6f6b0da1 | ||
|
|
6dc714371d | ||
|
|
5762b133e5 |
@@ -212,16 +212,22 @@ angular.module('shipyard', ['ngLodash'])
|
|||||||
* @return {number} Approximate shield strengh in MJ
|
* @return {number} Approximate shield strengh in MJ
|
||||||
*/
|
*/
|
||||||
.value('calcShieldStrength', function(mass, shields, sg, multiplier) {
|
.value('calcShieldStrength', function(mass, shields, sg, multiplier) {
|
||||||
if (mass <= sg.minmass) {
|
var opt;
|
||||||
|
if (mass < sg.minmass) {
|
||||||
return shields * multiplier * sg.minmul;
|
return shields * multiplier * sg.minmul;
|
||||||
}
|
}
|
||||||
|
if (mass > sg.maxmass) {
|
||||||
|
return shields * multiplier * sg.maxmul;
|
||||||
|
}
|
||||||
if (mass < sg.optmass) {
|
if (mass < sg.optmass) {
|
||||||
return shields * multiplier * (sg.minmul + (mass - sg.minmass) / (sg.optmass - sg.minmass) * (sg.optmul - sg.minmul));
|
opt = (sg.optmass - mass) / (sg.optmass - sg.minmass);
|
||||||
|
opt = 1 - Math.pow(1 - opt, 0.87);
|
||||||
|
return shields * multiplier * ((opt * sg.minmul) + ((1 - opt) * sg.optmul));
|
||||||
|
} else {
|
||||||
|
opt = (sg.optmass - mass) / (sg.maxmass - sg.optmass);
|
||||||
|
opt = -1 + Math.pow(1 + opt, 2.425);
|
||||||
|
return shields * multiplier * ( (-1 * opt * sg.maxmul) + ((1 + opt) * sg.optmul) );
|
||||||
}
|
}
|
||||||
if (mass < sg.maxmass) {
|
|
||||||
return shields * multiplier * (sg.optmul + (mass - sg.optmass) / (sg.maxmass - sg.optmass) * (sg.maxmul - sg.optmul));
|
|
||||||
}
|
|
||||||
return shields * multiplier * sg.maxmul;
|
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* Calculate the a ships speed based on mass, and thrusters. Currently Innacurate / Incomplete :(
|
* Calculate the a ships speed based on mass, and thrusters. Currently Innacurate / Incomplete :(
|
||||||
|
|||||||
@@ -35,8 +35,8 @@
|
|||||||
0
|
0
|
||||||
],
|
],
|
||||||
"internal": [
|
"internal": [
|
||||||
{ "class": 6, "eligible": { "Cargo Rack": 1, "Hull Reinforcement Package": 1 } },
|
{ "class": 6, "eligible": { "cr": 1, "hr": 1 } },
|
||||||
{ "class": 5, "eligible": { "Cargo Rack": 1, "Hull Reinforcement Package": 1 } },
|
{ "class": 5, "eligible": { "cr": 1, "hr": 1 } },
|
||||||
5,
|
5,
|
||||||
5,
|
5,
|
||||||
4,
|
4,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "coriolis_shipyard",
|
"name": "coriolis_shipyard",
|
||||||
"version": "1.5.0",
|
"version": "1.5.1",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/cmmcleod/coriolis"
|
"url": "https://github.com/cmmcleod/coriolis"
|
||||||
|
|||||||
Reference in New Issue
Block a user