From a574a1fa752621a121dca423465f2f6bc9660c4f Mon Sep 17 00:00:00 2001 From: Catherine Date: Tue, 13 Aug 2013 17:49:16 +0100 Subject: [PATCH 1/3] Added initial version of Effective Deployment Range highlighter. --- ...lighter-effective-deployment-range.user.js | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 plugins/portal-highlighter-effective-deployment-range.user.js diff --git a/plugins/portal-highlighter-effective-deployment-range.user.js b/plugins/portal-highlighter-effective-deployment-range.user.js new file mode 100644 index 00000000..ed668d32 --- /dev/null +++ b/plugins/portal-highlighter-effective-deployment-range.user.js @@ -0,0 +1,47 @@ +// ==UserScript== +// @id iitc-plugin-highlight-effective-deployment-range@cathesaurus +// @name IITC plugin: highlight portals by their effective resonator deployment range +// @category Highlighter +// @version 0.1.0.@@DATETIMEVERSION@@ +// @namespace https://github.com/jonatkins/ingress-intel-total-conversion +// @updateURL @@UPDATEURL@@ +// @downloadURL @@DOWNLOADURL@@ +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Uses the fill color of the portals to show the effective resonator deployment range +// @include https://www.ingress.com/intel* +// @include http://www.ingress.com/intel* +// @match https://www.ingress.com/intel* +// @match http://www.ingress.com/intel* +// @grant none +// ==/UserScript== + +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + +// use own namespace for plugin +window.plugin.portalHighlighterEffectiveDeploymentRange = function() {}; + +window.plugin.portalHighlighterEffectiveDeploymentRange.highlight = function(data) { + var d = data.portal.options.details; + var portal_deployment = 0; + if(getTeam(d) !== 0) { + if(window.getAvgResoDist(d) > 0) { + portal_deployment = (window.HACK_RANGE - window.getAvgResoDist(d))/window.HACK_RANGE; + } + if(portal_deployment > 0) { + var fill_opacity = portal_deployment*.85 + .15; + color = 'red'; + var params = {fillColor: color, fillOpacity: fill_opacity}; + data.portal.setStyle(params); + } + } + window.COLOR_SELECTED_PORTAL = '#f0f'; +} + +var setup = function() { + window.addPortalHighlighter('Effective Deployment', window.plugin.portalHighlighterEffectiveDeploymentRange.highlight); +} + +// PLUGIN END ////////////////////////////////////////////////////////// + +@@PLUGINEND@@ From 11dec6aeab39bec32c99a0ae7aa6729d6eff653b Mon Sep 17 00:00:00 2001 From: Catherine Date: Tue, 13 Aug 2013 18:44:18 +0100 Subject: [PATCH 2/3] Renamed plugin, and and only highlights where effective deployment distance is less than 36m. --- ...l-highlighter-bad-deployment-distance.user.js} | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename plugins/{portal-highlighter-effective-deployment-range.user.js => portal-highlighter-bad-deployment-distance.user.js} (68%) diff --git a/plugins/portal-highlighter-effective-deployment-range.user.js b/plugins/portal-highlighter-bad-deployment-distance.user.js similarity index 68% rename from plugins/portal-highlighter-effective-deployment-range.user.js rename to plugins/portal-highlighter-bad-deployment-distance.user.js index ed668d32..b1c23c58 100644 --- a/plugins/portal-highlighter-effective-deployment-range.user.js +++ b/plugins/portal-highlighter-bad-deployment-distance.user.js @@ -1,12 +1,12 @@ // ==UserScript== -// @id iitc-plugin-highlight-effective-deployment-range@cathesaurus -// @name IITC plugin: highlight portals by their effective resonator deployment range +// @id iitc-plugin-highlight-bad-deployment-distance@cathesaurus +// @name IITC plugin: highlight badly-deployed portals // @category Highlighter // @version 0.1.0.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ -// @description [@@BUILDNAME@@-@@BUILDDATE@@] Uses the fill color of the portals to show the effective resonator deployment range +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Uses the fill color of the portals to show the effective resonator deployment range, where that average is less than 36 metres // @include https://www.ingress.com/intel* // @include http://www.ingress.com/intel* // @match https://www.ingress.com/intel* @@ -19,13 +19,14 @@ // PLUGIN START //////////////////////////////////////////////////////// // use own namespace for plugin -window.plugin.portalHighlighterEffectiveDeploymentRange = function() {}; +window.plugin.portalHighlighterBadDeploymentDistance = function() {}; -window.plugin.portalHighlighterEffectiveDeploymentRange.highlight = function(data) { +window.plugin.portalHighlighterBadDeploymentDistance.highlight = function(data) { var d = data.portal.options.details; var portal_deployment = 0; + var acceptable_deployment_average = 36; if(getTeam(d) !== 0) { - if(window.getAvgResoDist(d) > 0) { + if(window.getAvgResoDist(d) > 0 && window.getAvgResoDist(d) < acceptable_deployment_average) { portal_deployment = (window.HACK_RANGE - window.getAvgResoDist(d))/window.HACK_RANGE; } if(portal_deployment > 0) { @@ -39,7 +40,7 @@ window.plugin.portalHighlighterEffectiveDeploymentRange.highlight = function(dat } var setup = function() { - window.addPortalHighlighter('Effective Deployment', window.plugin.portalHighlighterEffectiveDeploymentRange.highlight); + window.addPortalHighlighter('Bad Deployment Distance', window.plugin.portalHighlighterBadDeploymentDistance.highlight); } // PLUGIN END ////////////////////////////////////////////////////////// From 6a7815497c21095b7c770fb8063e0accb4de929c Mon Sep 17 00:00:00 2001 From: Catherine Date: Tue, 13 Aug 2013 19:02:53 +0100 Subject: [PATCH 3/3] Highlights only applied below 90% of maximum hack range. --- plugins/portal-highlighter-bad-deployment-distance.user.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/portal-highlighter-bad-deployment-distance.user.js b/plugins/portal-highlighter-bad-deployment-distance.user.js index b1c23c58..c85a61c5 100644 --- a/plugins/portal-highlighter-bad-deployment-distance.user.js +++ b/plugins/portal-highlighter-bad-deployment-distance.user.js @@ -24,9 +24,8 @@ window.plugin.portalHighlighterBadDeploymentDistance = function() {}; window.plugin.portalHighlighterBadDeploymentDistance.highlight = function(data) { var d = data.portal.options.details; var portal_deployment = 0; - var acceptable_deployment_average = 36; if(getTeam(d) !== 0) { - if(window.getAvgResoDist(d) > 0 && window.getAvgResoDist(d) < acceptable_deployment_average) { + if(window.getAvgResoDist(d) > 0 && window.getAvgResoDist(d) < window.HACK_RANGE*0.9) { portal_deployment = (window.HACK_RANGE - window.getAvgResoDist(d))/window.HACK_RANGE; } if(portal_deployment > 0) {