Skip to content

Commit

Permalink
Add 'Overclock' AutoGen2 mode (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryfeng authored and Unihedro committed May 13, 2017
1 parent 12f49a5 commit cecc5ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion NewUI2.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function initializeAllSettings() {

// Dimensional Generator settings:
createSetting('UseAutoGen', ['Auto Generator OFF', 'Auto Generator ON'], '<b>MASTER BUTTON</b> Dynamically switch generator modes. Note that there are three modes - you may need to click more than once to deactivate this. Required for the following mode management configurations to work. The Dimensional Generator is a building unlocked in The Magma, from z230.', 'multitoggle', 0, null, 'Magma');
createSetting('AutoGen2', ['Default', 'Microtick', 'Max Cap'], 'Before Z is reached, Microtick and Max Cap will switch between [Hybrid / Gain Fuel] to get EXACTLY one / FULL stacks of Capacity (not Storage) before using [Gain Mi]. Default will respect whatever you set it to and won\'t fiddle with it unless challenge overriding is on.', 'multitoggle', 2, null, 'Magma');
createSetting('AutoGen2', ['Default', 'Microtick', 'Max Cap', 'Overclock'], 'Before Z is reached, Microtick and Max Cap will switch between [Hybrid / Gain Fuel] to get EXACTLY one / FULL stacks of Capacity (not Storage) before using [Gain Mi]. Default will respect whatever you set it to and won\'t fiddle with it unless challenge overriding is on. Overclock will Gain Fuel until Z.', 'multitoggle', 2, null, 'Magma');
createSetting('AutoGen2End', 'End Early Mode Z', 'On and after Z, be done with the mode we start with and switch to the final mode. -1 to disable.', 'value', 300, null, 'Magma');
createSetting('AutoGen2SupplyEnd', 'End at Supply', 'On and after the zone for gathering the most magma by Supply, end Early Mode. Works alongside AutoGen2End and will end when either condition is met.', 'boolean', false, null, 'Magma');
createSetting('AutoGen3', ['Gain Mi', 'Gain Fuel', 'Hybrid'], 'Mode to use after Z / SupplyEnd.', 'multitoggle', 1, null, 'Magma');
Expand Down Expand Up @@ -788,6 +788,8 @@ function settingChanged(id) {
updateCustomButtons();
saveSettings();
checkPortalSettings();
if ((autoTrimpSettings.AutoGen2.value == 3) && game.generatorUpgrades["Overclocker"].upgrades <= 0)
tooltip('confirm', null, 'update', 'WARNING: You are set to Overclock but do not have any Overclocker upgrades. AutoGen2 will default to \'Max Cap\' in this case. If this is not desired, please fix your AutoGen2 setting.', 'cancelTooltip()', 'Cannot Overclock');
}


Expand Down
4 changes: 4 additions & 0 deletions modules/magma.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ function autoGenerator2() {
const mode = getPageSetting('AutoGen2'); // None : Microtick : Cap
if (!mode) // Default: move on
return;
else if (mode == 3 && game.generatorUpgrades["Overclocker"].upgrades > 0) { // Only trigger overclock if we have Overclocker upgrades.
changeGeneratorState(FUEL);
return;
}

const fuel = game.global.magmaFuel;
const want = mode == 1 ? getFuelBurnRate() : getGeneratorFuelCap();
Expand Down

0 comments on commit cecc5ee

Please sign in to comment.