Compare commits

..

4 Commits
1.5.0 ... 1.5.1

Author SHA1 Message Date
Colin McLeod
ff25b55c1f Lint fix 2015-09-03 00:22:50 -07:00
Colin McLeod
ae6f6b0da1 Bumping version to 1.5.1 2015-09-03 00:21:23 -07:00
Colin McLeod
6dc714371d Update Shield Strength calculation 2015-09-03 00:19:58 -07:00
Colin McLeod
5762b133e5 Fix Orca first interal compartment restrictions 2015-09-03 00:19:30 -07:00
3 changed files with 15 additions and 9 deletions

View File

@@ -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 :(

View File

@@ -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,

View File

@@ -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"