Skip to content
This repository has been archived by the owner on Apr 7, 2023. It is now read-only.

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin McLeod committed Sep 3, 2015
1 parent ae6f6b0 commit ff25b55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/js/shipyard/module-shipyard.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,19 @@ angular.module('shipyard', ['ngLodash'])
* @return {number} Approximate shield strengh in MJ
*/
.value('calcShieldStrength', function(mass, shields, sg, multiplier) {
var opt;
if (mass < sg.minmass) {
return shields * multiplier * sg.minmul;
}
if (mass > sg.maxmass) {
return shields * multiplier * sg.maxmul;
}
if (mass < sg.optmass) {
var opt = (sg.optmass - mass) / (sg.optmass - sg.minmass);
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 {
var opt = (sg.optmass - mass) / (sg.maxmass - sg.optmass);
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) );
}
Expand Down

0 comments on commit ff25b55

Please sign in to comment.