diff --git a/fc_main.js b/fc_main.js index 5db40868..852c49ae 100644 --- a/fc_main.js +++ b/fc_main.js @@ -102,7 +102,8 @@ function setOverrides() { Game.sayTime = function(time, detail) { return timeDisplay(time / Game.fps); } - Game.oldReset = Game.Reset; + Game.tooltip.oldDraw = Game.tooltip.draw; + Game.tooltip.draw = fcDraw; Game.oldReset = Game.Reset; Game.oldWriteSave = Game.WriteSave; Game.oldLoadSave = Game.LoadSave; Game.Reset = fcReset; @@ -299,6 +300,15 @@ function timeDisplay(seconds) { return (days + hours + minutes + seconds).trim(); } +function fcDraw(from, text, origin) { + if (typeof(text) == "string") { + if (text.includes('Devastation')) { + text = text.replace(/\+\d+\%/,"+" + Math.round((Game.hasBuff('Devastation').multClick - 1) * 100) + "%") + } + } + Game.tooltip.oldDraw(from, text, origin); +} + function fcReset() { Game.CollectWrinklers(); if (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')) { @@ -623,7 +633,7 @@ function swapIn(godId, targetSlot) { //mostly code copied from minigamePantheon. function autoRigidel() { if (!T) return; //Exit if pantheon doesnt even exist - var timeToRipe = (Game.lumpRipeAge - (Date.now() - Game.lumpT))/60000; //Minutes until sugar lump ripens + var timeToRipe = (Math.ceil(Game.lumpRipeAge) - (Date.now() - Game.lumpT))/60000; //Minutes until sugar lump ripens var orderLvl = Game.hasGod('order') ? Game.hasGod('order') : 0; switch (orderLvl) { case 0: //Rigidel isn't in a slot @@ -2170,43 +2180,45 @@ function autoGSBuy() { function safeBuy(bldg,count) { // If store is in Sell mode, Game.Objects[].buy will sell the building! - if (Game.buyMode == -1) - { - document.getElementById('storeBulkBuy').click(); + if (Game.buyMode == -1) { + Game.buyMode = 1; bldg.buy(count); - document.getElementById('storeBulkSell').click(); + Game.buyMode = -1 } else { bldg.buy(count); } } -function autoGodzamokAction() -{ - if (!T) return; //Just leave if Pantheon isn't here yet - //Now has option to not trigger until current Devastation buff expires (i.e. won't rapidly buy & sell cursors throughout Godzamok duration) - //added Farms to autoGodzamok selling. 1 farm always left to prevent garden from disappearing - if (Game.hasGod('ruin') && (!Game.hasBuff('Devastation')) && hasClickBuff()) - { - if ((FrozenCookies.autoGodzamok >= 1) && Game.Objects['Cursor'].amount >= 10) - { - var count = Game.Objects['Cursor'].amount; - Game.Objects['Cursor'].sell(count); - } - if ((FrozenCookies.autoGodzamok >= 1) && Game.Objects['Farm'].amount >= 10) - { - var count2 = Game.Objects['Farm'].amount-1; - Game.Objects['Farm'].sell(count2); +function autoGodzamokAction() { + if ( T && FrozenCookies.autoGodzamok ) { // if Pantheon is here and autoGodzamok is set + if ( Game.hasGod('ruin') && ( Game.Objects['Cursor'].amount > 10 || Game.Objects['Farm'].amount > 10 ) ) { + var countC = Game.Objects['Cursor'].amount; + var countF = Game.Objects['Farm'].amount-1; + + //Automatically sell all cursors and farms (except one) during Dragonflight and Click Frenzy if you worship Godzamok and prevent rapid buy/sell spam + if ( ( FrozenCookies.autoGodzamok >= 1 ) && hasClickBuff() && !Game.hasBuff('Devastation') ) { + Game.Objects['Cursor'].sell( countC ); + Game.Objects['Farm'].sell( countF ); + + if ( FrozenCookies.autoBuy == 1 ) { + if ( ( FrozenCookies.cursorLimit ) && countC > FrozenCookies.cursorMax ) { + safeBuy( Game.Objects['Cursor'], FrozenCookies.cursorMax ); + logEvent( "AutoGodzamok", "Bought " + FrozenCookies.cursorMax + " cursors" ); + } else { + safeBuy( Game.Objects['Cursor'], countC ); + logEvent( "AutoGodzamok", "Bought " + countC + " cursors" ); + } + if ( ( FrozenCookies.farmLimit ) && countF > ( FrozenCookies.farmMax - 1 ) ) { + safeBuy( Game.Objects['Farm'], FrozenCookies.farmMax - 1 ); + logEvent( "AutoGodzamok", "Bought " + ( FrozenCookies.farmMax - 1 ) + " farms" ); + } else { + safeBuy( Game.Objects['Farm'], countF ); + logEvent( "AutoGodzamok", "Bought " + countF + " farms" ); + } + } + } } - - if ((FrozenCookies.autoGodzamok >= 1) && Game.Objects['Cursor'].amount < 10) - { - safeBuy(Game.Objects['Cursor'],count); - } - if ((FrozenCookies.autoGodzamok >= 1) && Game.Objects['Farm'].amount < 10) - { - safeBuy(Game.Objects['Farm'],count2); - } - } + } } function goldenCookieLife() { @@ -2259,7 +2271,7 @@ function autoCookie() { } if (FrozenCookies.autoSL) { var started = Game.lumpT; - var ripeAge = Game.lumpRipeAge; + var ripeAge = Math.ceil(Game.lumpRipeAge); if ((Date.now() - started) >= ripeAge) { Game.clickLump(); } diff --git a/fc_preferences.js b/fc_preferences.js index 208975af..ca2cc2be 100644 --- a/fc_preferences.js +++ b/fc_preferences.js @@ -106,8 +106,8 @@ FrozenCookies.preferenceValues = { 'default': 0 }, 'autoGodzamok': { - 'hint': 'Automatically sell all cursors and farms (except one) during Dragonflight and Click Frenzy if you worship Godzamok ("Sane" prevents rapid buy/sell spam)', - 'display': ['Auto-Godzamok OFF', 'Auto-Godzamok ON', 'Auto-Godzamok ON (Sane)', 'Auto-Godzamok ON (REALLY INSANE)'], + 'hint': 'Automatically sell all cursors and farms (except one farm) during Dragonflight and Click Frenzy if you worship Godzamok and prevents rapid buy/sell spam', + 'display': ['Auto-Godzamok OFF', 'Auto-Godzamok ON'], 'default': 0 }, 'autoSpell': { diff --git a/frozen_cookies.js b/frozen_cookies.js index b6d363e4..ab89827b 100644 --- a/frozen_cookies.js +++ b/frozen_cookies.js @@ -8,7 +8,7 @@ var baseUrl = scriptElement !== null ? var FrozenCookies = { 'baseUrl': baseUrl, 'branch': '', - 'version': '1.8.0' + 'version': '1.8.1' }; // Load external libraries