diff --git a/code/portal_detail_display_tools.js b/code/portal_detail_display_tools.js index 3df146c82..a8747b0d0 100644 --- a/code/portal_detail_display_tools.js +++ b/code/portal_detail_display_tools.js @@ -226,7 +226,7 @@ window.getMitigationText = function(d,linkCount) { + '- excess:\t'+mitigationDetails.excess+'\n' + 'From\n' + '- shields:\t'+mitigationDetails.shields+'\n' - + '- links:\t'+mitigationDetails.links; + + '- links:\t'+mitigationDetails.links+' ('+mitigationDetails.linkDefenseBoost+'x)'; return ['shielding', mitigationShort, title]; } diff --git a/code/portal_info.js b/code/portal_info.js index 29d607c6c..079ff2820 100644 --- a/code/portal_info.js +++ b/code/portal_info.js @@ -239,15 +239,30 @@ window.getPortalShieldMitigation = function(d) { return mitigation; } +window.getPortalLinkDefenseBoost = function(d) { + var ultraLinkAmps = getPortalModsByType(d, 'ULTRA_LINK_AMP'); + + var linkDefenseBoost = 1; + + $.each(ultraLinkAmps, function (index, ultraLinkAmp) { + linkDefenseBoost *= parseInt(ultraLinkAmp.stats.LINK_DEFENSE_BOOST) / 1000; + }); + + return Math.round(10 * linkDefenseBoost) / 10; +} + window.getPortalLinksMitigation = function(linkCount) { var mitigation = Math.round(400/9*Math.atan(linkCount/Math.E)); return mitigation; } window.getPortalMitigationDetails = function(d,linkCount) { + var linkDefenseBoost = getPortalLinkDefenseBoost(d); + var mitigation = { shields: getPortalShieldMitigation(d), - links: getPortalLinksMitigation(linkCount) + links: getPortalLinksMitigation(linkCount) * linkDefenseBoost, + linkDefenseBoost: linkDefenseBoost }; // mitigation is limited to 95% (as confirmed by Brandon Badger on G+)