diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js index 3c51cb80..7d1851bc 100644 --- a/code/portal_detail_display.js +++ b/code/portal_detail_display.js @@ -169,11 +169,15 @@ window.getPortalMiscDetails = function(guid,d) { // collect some random data that’s not worth to put in an own method var linkInfo = getPortalLinks(guid); + var maxOutgoing = getMaxOutgoingLinks(d); var linkCount = linkInfo.in.length + linkInfo.out.length; var links = {incoming: linkInfo.in.length, outgoing: linkInfo.out.length}; - function linkExpl(t) { return ''+t+''; } - var linksText = [linkExpl('links'), linkExpl(links.outgoing+' out / '+links.incoming+' in')]; + var title = 'at most ' + maxOutgoing + ' outgoing links\n' + + links.outgoing + ' links out\n' + + links.incoming + ' links in\n' + + '(' + (links.outgoing+links.incoming) + ' total)' + var linksText = ['links', links.outgoing+' out / '+links.incoming+' in', title]; var player = d.owner ? '' + d.owner + '' diff --git a/code/portal_detail_display_tools.js b/code/portal_detail_display_tools.js index abd54a50..849cb35a 100644 --- a/code/portal_detail_display_tools.js +++ b/code/portal_detail_display_tools.js @@ -115,6 +115,7 @@ window.getModDetails = function(d) { else if (key === 'ATTACK_FREQUENCY') val = (val/1000) +'x'; // 2000 = 2x else if (key === 'FORCE_AMPLIFIER') val = (val/1000) +'x'; // 2000 = 2x else if (key === 'LINK_RANGE_MULTIPLIER') val = (val/1000) +'x'; // 2000 = 2x + else if (key === 'LINK_DEFENSE_BOOST') val = (val/1000) +'x'; // 1500 = 1.5x else if (key === 'REMOVAL_STICKINESS' && val > 100) val = (val/10000)+'%'; // an educated guess // else display unmodified. correct for shield mitigation and multihack - unknown for future/other mods diff --git a/code/portal_info.js b/code/portal_info.js index 663dab51..29d607c6 100644 --- a/code/portal_info.js +++ b/code/portal_info.js @@ -207,7 +207,8 @@ window.getPortalModsByType = function(d, type) { TURRET: 'HIT_BONUS', // and/or ATTACK_FREQUENCY?? HEATSINK: 'HACK_SPEED', MULTIHACK: 'BURNOUT_INSULATION', - LINK_AMPLIFIER: 'LINK_RANGE_MULTIPLIER' + LINK_AMPLIFIER: 'LINK_RANGE_MULTIPLIER', + ULTRA_LINK_AMP: 'OUTGOING_LINKS_BONUS', // and/or LINK_DEFENSE_BOOST?? }; var stat = typeToStat[type]; @@ -257,6 +258,17 @@ window.getPortalMitigationDetails = function(d,linkCount) { return mitigation; } +window.getMaxOutgoingLinks = function(d) { + var linkAmps = getPortalModsByType(d, 'ULTRA_LINK_AMP'); + + var links = 8; + + linkAmps.forEach(function(mod, i) { + links += parseInt(mod.stats.OUTGOING_LINKS_BONUS); + }); + + return links; +}; window.getPortalHackDetails = function(d) { diff --git a/code/utils_misc.js b/code/utils_misc.js index f2f09ccb..f1892b82 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -335,10 +335,11 @@ window.uniqueArray = function(arr) { window.genFourColumnTable = function(blocks) { var t = $.map(blocks, function(detail, index) { if(!detail) return ''; + var title = detail[2] ? ' title="'+escapeHtmlSpecialChars(detail[2]) + '"' : ''; if(index % 2 === 0) - return '