Compare commits
2 Commits
05b76cec5c
...
046348a71e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
046348a71e | ||
|
|
d0e2ecfdea |
@@ -1,7 +1,11 @@
|
||||
// ==UserScript==
|
||||
// @name IITC plugin: ResTools BB Watch Reloaded
|
||||
// @namespace https://git.martinvylet.cz/vykend/ResTools-BB-Watch-Reloaded
|
||||
<<<<<<< HEAD
|
||||
// @version 0.6
|
||||
=======
|
||||
// @version 0.5.2
|
||||
>>>>>>> 05b76cec5c49b9a62d1b257c90d75c8e9252fb89
|
||||
// @description Scan window for BBs on ornamented portals, then check results
|
||||
// @author vikend
|
||||
// @icon
|
||||
@@ -206,15 +210,16 @@ function wrapper(plugin_info)
|
||||
for (let i in results) {
|
||||
let portal = results[i];
|
||||
if (ornamented.find((obj) => obj.Guid === portal.Guid)) {
|
||||
var foundObj = ornamented.find((obj) => obj.Guid === portal.Guid);
|
||||
if (portal.IsWinnerRes) {
|
||||
resWin++;
|
||||
if (portal.IsVolatile) {
|
||||
if (foundObj.IsVolatile) {
|
||||
resVolatiles++;
|
||||
}
|
||||
}
|
||||
else if (portal.IsWinnerEnl) {
|
||||
enlWin++;
|
||||
if (portal.IsVolatile) {
|
||||
if (foundObj.IsVolatile) {
|
||||
enlVolatiles++;
|
||||
}
|
||||
}
|
||||
@@ -235,13 +240,20 @@ function wrapper(plugin_info)
|
||||
{
|
||||
let waves = [];
|
||||
for (let i in window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS) {
|
||||
var volatiles = 0;
|
||||
|
||||
for (var j = 0; j < window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0].length; j++) {
|
||||
if (window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0][j].IsVolatile === true) {
|
||||
volatiles++;
|
||||
}
|
||||
}
|
||||
let results = window.plugin.restoolsBBWatchReloaded.computeBeacons(i);
|
||||
let wave = {
|
||||
WaveNumber: Number(i) +1,
|
||||
volatilesCount: 0,
|
||||
volatilesCount: volatiles,
|
||||
beaconCount: window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0].length,
|
||||
PercentageRes: window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0].length/results.resWin,
|
||||
PercentageEnl: window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0].length/results.enlWin,
|
||||
PercentageRes: (results.resWin/window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0].length)*100,
|
||||
PercentageEnl: (results.enlWin/window.plugin.restoolsBBWatchReloaded.WAVE_PORTALS[i][0].length)*100,
|
||||
BeaconsWonRes: results.resWin,
|
||||
BeaconsWonResVolatiles: results.resVolatiles,
|
||||
BeaconsWonEnl: results.enlWin,
|
||||
@@ -320,16 +332,16 @@ function wrapper(plugin_info)
|
||||
<tr>
|
||||
<td>`+ wave.WaveNumber +`</td>
|
||||
<td>`+ wave.beaconCount + " (" + wave.volatilesCount + ")" + `</td>
|
||||
<td>`+ wave.PercentageRes +`</td>
|
||||
<td>`+ wave.PercentageEnl +`</td>
|
||||
<td>`+ wave.PercentageRes.toFixed(2) +`</td>
|
||||
<td>`+ wave.PercentageEnl.toFixed(2) +`</td>
|
||||
<td>`+ wave.BeaconsWonRes + " (" + wave.BeaconsWonResVolatiles + ")" + `</td>
|
||||
<td>`+ wave.BeaconsWonEnl + " (" + wave.BeaconsWonEnlVolatiles + ")" + `</td>
|
||||
</tr>
|
||||
`;
|
||||
}
|
||||
|
||||
let bestScore = `<p style="font-weight: bold;">BB SCORING ESTIMATE: RES ` + maxBeaconsWonRes/(maxBeaconsWonRes+maxBeaconsWonEnl) + `:` + maxBeaconsWonEnl/(maxBeaconsWonRes+maxBeaconsWonEnl)+ ` ENL</p>`;
|
||||
let bestScoreVolatiles = `<p style="font-weight: bold;">BB SCORING ESTIMATE (including volatiles, speculative): RES ` + (maxBeaconsWonRes+ 2*volatilesBeaconsWonResInBestWave)/((maxBeaconsWonRes+ 2*volatilesBeaconsWonResInBestWave)+(maxBeaconsWonEnl+ 2*volatilesBeaconsWonEnlInBestWave)) + `:` + (maxBeaconsWonEnl+ 2*volatilesBeaconsWonEnlInBestWave)/((maxBeaconsWonRes+ 2*volatilesBeaconsWonResInBestWave)+(maxBeaconsWonEnl+ 2*volatilesBeaconsWonEnlInBestWave))+ ` ENL</p>`;
|
||||
let bestScore = `<p style="font-weight: bold;">BB SCORING ESTIMATE: RES ` + (maxBeaconsWonRes/(maxBeaconsWonRes+maxBeaconsWonEnl)*100).toFixed(2) + `:` + (maxBeaconsWonEnl/(maxBeaconsWonRes+maxBeaconsWonEnl)*100).toFixed(2) + ` ENL</p>`;
|
||||
let bestScoreVolatiles = `<p style="font-weight: bold;">BB SCORING ESTIMATE (including volatiles, speculative): RES ` + ((maxBeaconsWonRes+ 2*volatilesBeaconsWonResInBestWave)/((maxBeaconsWonRes+ 2*volatilesBeaconsWonResInBestWave)+(maxBeaconsWonEnl+ 2*volatilesBeaconsWonEnlInBestWave))*100).toFixed(2) + `:` + ((maxBeaconsWonEnl+ 2*volatilesBeaconsWonEnlInBestWave)/((maxBeaconsWonRes+ 2*volatilesBeaconsWonResInBestWave)+(maxBeaconsWonEnl+ 2*volatilesBeaconsWonEnlInBestWave))*100).toFixed(2)+ ` ENL</p>`;
|
||||
|
||||
let htmlEnd = `
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user