Skip to content

Commit

Permalink
Add all Fast-Forward Snimp icons to 2nd icon instead of overwriting m…
Browse files Browse the repository at this point in the history
…ain icon
  • Loading branch information
genbtc committed Nov 5, 2023
1 parent 2a7bb4b commit 3f05ef0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 31 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 7 additions & 18 deletions modules/fight-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@
var $rows = Array.prototype.slice.call(M["fightinfo"].$worldGrid.children);
}

// Rows are in inverse order somewhy
$rows = $rows.reverse();

// DOM cells
var $cells = [];

Expand All @@ -96,40 +93,32 @@
// Process all cells
for (var i = 0; i < $cells.length; i++)
{
// DOM cell
// DOM cell View
var $cell = $cells[i];
// Cell data
// Cell data Model
var cell = cells[i];


if (cell.name.toLowerCase().indexOf('skele') > -1) // Skeletimp cell
{
if(cell.special.length === 0)
$cell.innerHTML = "<span class=\"glyphicon glyphicon-italic\"></span> ";

$cell.insertAdjacentHTML('beforeend', "<span class=\"glyphicon glyphicon-italic\"></span> ");
$cell.title = cell.name;
$cell.style.textShadow = '0px 0px 10px #ffffff';
}
else if (M["fightinfo"].exotics.indexOf(cell.name) > -1) // Exotic cell
else if (M["fightinfo"].exotics.indexOf(cell.name) > -1) // Exotic cell
{
if(cell.special.length === 0)
$cell.innerHTML = "<span class=\"glyphicon glyphicon-sunglasses\"></span> ";

$cell.insertAdjacentHTML('beforeend', "<span class=\"glyphicon glyphicon-sunglasses\"></span> ");
$cell.title = cell.name;
$cell.style.textShadow = '0px 0px 10px #fb753f';
}
else if (M["fightinfo"].powerful.indexOf(cell.name) > -1) // Powerful imp
{
if(cell.special.length === 0)
$cell.innerHTML = "<span class=\"glyphicon glyphicon-hazard\"></span> ";

$cell.insertAdjacentHTML('beforeend', "<span class=\"glyphicon glyphicon-hazard\"></span> ");
$cell.title = cell.name;
$cell.style.textShadow = '0px 0px 10px #8c0000';
}
else if (M["fightinfo"].fast.indexOf(cell.name) > -1) // Fast imp
{
$cell.innerHTML = "<span class=\"glyphicon glyphicon-forward\"></span> ";

$cell.insertAdjacentHTML('beforeend', "<span class=\"glyphicon glyphicon-forward\"></span>");
$cell.title = cell.name;
$cell.style.textShadow = '0px 0px 10px #ffffff';
}
Expand Down
28 changes: 15 additions & 13 deletions modules/gather.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MODULES["gather"] = {};
//These can be changed (in the console) if you know what you're doing:
MODULES["gather"].minTraps = 500;
MODULES["gather"].minTraps = 101;
MODULES["gather"].minScienceAmount = 100;
MODULES["gather"].minScienceSeconds = 60;
MODULES["gather"].minBreedingTrimps = 6;
Expand Down Expand Up @@ -30,26 +30,28 @@ function manualLabor() {
}

var wannaTrapTrimps = (breedingTrimps < MODULES["gather"].minBreedingTrimps || trapperTrapUntilFull || watchJumpstartTraps);
//Traps and Trimps: //build trap when at 0 traps //try buying in the if
if(trapTrimpsOK && wannaTrapTrimps && game.buildings.Trap.owned == 0 && canAffordBuilding('Trap') && !safeBuyBuilding('Trap')) {
//Traps and Trimps: // when at 0 traps //try buying trap in the if
if (trapTrimpsOK && wannaTrapTrimps && game.buildings.Trap.owned == 0 && canAffordBuilding('Trap') && safeBuyBuilding('Trap')) {
//safeBuyBuilding returns false if item is already in queue
setGather('buildings'); //then build if it bought
}
//BuildTrap/CheckTrap > 1
else if (trapTrimpsOK && wannaTrapTrimps && game.buildings.Trap.owned > 0) {
setGather('trimps');
if (trapperTrapUntilFull && (game.global.buildingsQueue.length == 0 || game.buildings.Trap.owned == 1) && !game.global.trapBuildAllowed && canAffordBuilding('Trap') && safeBuyBuilding('Trap')) //get ahead on trap building since it is always needed for Trapper
return;
//get ahead on trap building since it is always needed for Trapper
trapperTrapUntilFull && (game.global.buildingsQueue.length == 0 || game.buildings.Trap.owned == 1) && !game.global.trapBuildAllowed && canAffordBuilding('Trap') && safeBuyBuilding('Trap')
}
else if (getPageSetting('ManualGather2') != 2 && game.resources.science.owned < MODULES["gather"].minScienceAmount && document.getElementById('scienceCollectBtn').style.display != 'none' && document.getElementById('science').style.visibility != 'hidden')
setGather('science');
//if we have more than 2 buildings in queue, or (our modifier is real fast and trapstorm is off), build
else if (bwRewardUnlocked("Foremany") && (game.global.buildingsQueue.length ? (game.global.buildingsQueue.length > 1 || game.global.autoCraftModifier == 0 || (getPlayerModifier() > 1000 && game.global.buildingsQueue[0] != 'Trap.1')) : false)) {
else if (game.global.buildingsQueue.length ? (game.global.buildingsQueue.length > 1 || game.global.autoCraftModifier == 0 || (getPlayerModifier() > 1000 && game.global.buildingsQueue[0] != 'Trap.1')) : false) {
setGather('buildings');
}
//if trapstorm is off (likely we havent gotten it yet, the game is still early, buildings take a while to build ), then Prioritize Storage buildings when they hit the front of the queue (should really be happening anyway since the queue should be >2(fits the clause above this), but in case they are the only object in the queue.)
else if (!game.global.trapBuildToggled && (game.global.buildingsQueue[0] == 'Barn.1' || game.global.buildingsQueue[0] == 'Shed.1' || game.global.buildingsQueue[0] == 'Forge.1')){
setGather('buildings');
}
//bwRewardUnlocked("Foremany")
else if (getPageSetting('ManualGather2') != 2 && game.resources.science.owned < MODULES["gather"].minScienceAmount && document.getElementById('scienceCollectBtn').style.display != 'none' && document.getElementById('science').style.visibility != 'hidden') {
setGather('science');
}
//if we have some upgrades sitting around which we don't have enough science for, gather science
else if (game.resources.science.owned < getScienceNeeded() && document.getElementById('scienceCollectBtn').style.display != 'none' && document.getElementById('science').style.visibility != 'hidden') {
Expand All @@ -63,7 +65,7 @@ function manualLabor() {
}
else if (trapTrimpsOK && targetBreed < getBreedTime(true)){
//combined to optimize code.
if (game.buildings.Trap.owned < MODULES["gather"].minTraps && canAffordBuilding('Trap')) {
if (lowOnTraps && canAffordBuilding('Trap')) {
safeBuyBuilding('Trap');
setGather('buildings');
}
Expand Down Expand Up @@ -125,7 +127,7 @@ function manualLabor() {
}
}

//NEW: #2 "Auto Gather/Build" (+no science)
//NEW: #2 "Auto Gather/Build"
function manualLabor2() {
if (getPageSetting('ManualGather2')==0) return;
//vars
Expand Down Expand Up @@ -174,16 +176,16 @@ function manualLabor2() {
((game.global.buildingsQueue.length >= 2 && manualBuildSpeedAdvantage > 3) ||
//Prioritize Storage buildings when they hit the front of the queue (in case they are the only object in the queue).
(game.global.buildingsQueue[0] == 'Barn.1' || game.global.buildingsQueue[0] == 'Shed.1' || game.global.buildingsQueue[0] == 'Forge.1') ||
//manualBuild traps if we have TrapTrimps on, AutoTraps on, and we own less than (5) traps.
//manualBuild traps if we have TrapTrimps on, AutoTraps on, and we own less than min (100) traps.
(trapTrimpsOK && game.global.trapBuildAllowed && game.global.trapBuildToggled && lowOnTraps))) {
setGather('buildings');//buildBuildings = true;
return;
}

//Sciencey:
//if we have some upgrades sitting around which we don't have enough science for, gather science
//check for any upgrades sitting around which we don't have enough science for, then gather science
if (document.getElementById('scienceCollectBtn').style.display != 'none' && document.getElementById('science').style.visibility != 'hidden') {
//if we have less than (100) science or less than a minute of science
//if we have less than min (100) science or less than a minute of science
if (getPageSetting('ManualGather2') != 2 && game.resources.science.owned < MODULES["gather"].minScienceAmount ||
(game.resources.science.owned < getPsString('science', true) * MODULES["gather"].minScienceSeconds && game.global.turkimpTimer < 1)) {
setGather('science');
Expand Down

0 comments on commit 3f05ef0

Please sign in to comment.