Merge pull request #704 from khabraken/master
Fix the calculation for Link Amp range boost to be generic, so VRLA boos...
This commit is contained in:
commit
64ad7274b4
@ -68,22 +68,22 @@ window.getLinkAmpRangeBoost = function(d) {
|
|||||||
// (at the time of writing, only rare link amps have been seen in the wild, so there's a little guesswork at how
|
// (at the time of writing, only rare link amps have been seen in the wild, so there's a little guesswork at how
|
||||||
// the stats work and combine - jon 2013-06-26)
|
// the stats work and combine - jon 2013-06-26)
|
||||||
|
|
||||||
// link amps scale: first is full, second half, the last two a quarter
|
// link amps scale: first is full, second a quarter, the last two an eigth
|
||||||
var scale = [1.0, 0.5, 0.25, 0.25];
|
var scale = [1.0, 0.25, 0.125, 0.125];
|
||||||
|
|
||||||
var boost = 1.0; // initial boost is 1.0 (i.e. no boost over standard range)
|
var boost = 0.0; // initial boost is 0.0 (i.e. no boost over standard range)
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
||||||
$.each(d.portalV2.linkedModArray, function(ind, mod) {
|
$.each(d.portalV2.linkedModArray, function(ind, mod) {
|
||||||
if(mod && mod.type === 'LINK_AMPLIFIER' && mod.stats && mod.stats.LINK_RANGE_MULTIPLIER) {
|
if(mod && mod.type === 'LINK_AMPLIFIER' && mod.stats && mod.stats.LINK_RANGE_MULTIPLIER) {
|
||||||
// link amp stat LINK_RANGE_MULTIPLIER is 2000 for rare, and gives 2x boost to the range
|
// link amp stat LINK_RANGE_MULTIPLIER is 2000 for rare, and gives 2x boost to the range
|
||||||
var baseMultiplier = mod.stats.LINK_RANGE_MULTIPLIER/1000;
|
var baseMultiplier = mod.stats.LINK_RANGE_MULTIPLIER/1000;
|
||||||
boost += (baseMultiplier-1)*scale[count];
|
boost += baseMultiplier*scale[count];
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return boost;
|
return (count > 0) ? boost : 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user