@@ -605,7 +605,7 @@ CM.Disp.FormatTime = function(time, format) {
605
605
return str ;
606
606
}
607
607
608
- CM . Disp . GetTimeColor = function ( price , bank , cps ) {
608
+ CM . Disp . GetTimeColor = function ( price , bank , cps , time ) {
609
609
var color ;
610
610
var text ;
611
611
if ( bank >= price ) {
@@ -618,7 +618,12 @@ CM.Disp.GetTimeColor = function(price, bank, cps) {
618
618
}
619
619
}
620
620
else {
621
- var time = ( price - bank ) / cps ;
621
+ if ( typeof time !== 'undefined' ) {
622
+ var time = time ;
623
+ }
624
+ else {
625
+ var time = ( price - bank ) / cps ;
626
+ }
622
627
text = CM . Disp . FormatTime ( time ) ;
623
628
if ( time > 300 ) {
624
629
color = CM . Disp . colorRed ;
@@ -2064,6 +2069,15 @@ CM.Disp.ToggleToolWarnCautPos = function() {
2064
2069
}
2065
2070
}
2066
2071
2072
+ CM . Disp . CalculateGrimoireRefillTime = function ( currentMagic , maxMagic , targetMagic ) {
2073
+ var count = 0 ;
2074
+ while ( currentMagic < targetMagic ) {
2075
+ currentMagic += Math . max ( 0.002 , Math . pow ( currentMagic / Math . max ( maxMagic , 100 ) , 0.5 ) ) * 0.002 ;
2076
+ count ++ ;
2077
+ }
2078
+ return count / Game . fps ;
2079
+ }
2080
+
2067
2081
CM . Disp . AddTooltipBuild = function ( ) {
2068
2082
CM . Disp . TooltipBuildBack = [ ] ;
2069
2083
for ( var i in Game . Objects ) {
@@ -2086,6 +2100,18 @@ CM.Disp.AddTooltipUpgrade = function() {
2086
2100
}
2087
2101
}
2088
2102
2103
+ CM . Disp . AddTooltipGrimoire = function ( ) {
2104
+ if ( Game . Objects [ 'Wizard tower' ] . minigameLoaded ) {
2105
+ CM . Disp . TooltipGrimoireBack = [ ] ;
2106
+ for ( var i in Game . Objects [ 'Wizard tower' ] . minigame . spellsById ) {
2107
+ if ( l ( 'grimoireSpell' + i ) . onmouseover != null ) {
2108
+ CM . Disp . TooltipGrimoireBack [ i ] = l ( 'grimoireSpell' + i ) . onmouseover ;
2109
+ eval ( 'l(\'grimoireSpell\' + i).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'g\', \'' + i + '\');}, \'this\'); Game.tooltip.wobble();}' ) ;
2110
+ }
2111
+ }
2112
+ }
2113
+ }
2114
+
2089
2115
CM . Disp . Tooltip = function ( type , name ) {
2090
2116
if ( type == 'b' ) {
2091
2117
l ( 'tooltip' ) . innerHTML = Game . Objects [ name ] . tooltip ( ) ;
@@ -2120,16 +2146,19 @@ CM.Disp.Tooltip = function(type, name) {
2120
2146
}
2121
2147
}
2122
2148
}
2123
- else { // Upgrades
2149
+ else if ( type == 'u' ) {
2124
2150
if ( ! Game . UpgradesInStore [ name ] ) return '' ;
2125
2151
l ( 'tooltip' ) . innerHTML = Game . crate ( Game . UpgradesInStore [ name ] , 'store' , undefined , undefined , 1 ) ( ) ;
2126
2152
}
2153
+ else { // Grimoire
2154
+ l ( 'tooltip' ) . innerHTML = Game . Objects [ 'Wizard tower' ] . minigame . spellTooltip ( name ) ( ) ;
2155
+ }
2127
2156
2128
2157
var area = document . createElement ( 'div' ) ;
2129
2158
area . id = 'CMTooltipArea' ;
2130
2159
l ( 'tooltip' ) . appendChild ( area ) ;
2131
2160
2132
- if ( CM . Config . Tooltip == 1 && ( type != 'b ' || Game . buyMode == 1 ) ) {
2161
+ if ( CM . Config . Tooltip == 1 && ( type == 'u ' || ( type == 'b' && Game . buyMode == 1 ) ) ) {
2133
2162
l ( 'tooltip' ) . firstChild . style . paddingBottom = '4px' ;
2134
2163
var tooltip = document . createElement ( 'div' ) ;
2135
2164
tooltip . style . border = '1px solid' ;
@@ -2144,6 +2173,7 @@ CM.Disp.Tooltip = function(type, name) {
2144
2173
div . textContent = text ;
2145
2174
return div ;
2146
2175
}
2176
+
2147
2177
tooltip . appendChild ( header ( 'Bonus Income' ) ) ;
2148
2178
var income = document . createElement ( 'div' ) ;
2149
2179
income . style . marginBottom = '4px' ;
@@ -2160,7 +2190,7 @@ CM.Disp.Tooltip = function(type, name) {
2160
2190
time . id = 'CMTooltipTime' ;
2161
2191
tooltip . appendChild ( time ) ;
2162
2192
2163
- l ( 'tooltip' ) . appendChild ( tooltip ) ;
2193
+ area . appendChild ( tooltip ) ;
2164
2194
}
2165
2195
2166
2196
CM . Disp . tooltipType = type ;
@@ -2174,92 +2204,141 @@ CM.Disp.Tooltip = function(type, name) {
2174
2204
CM . Disp . UpdateTooltip = function ( ) {
2175
2205
if ( l ( 'tooltipAnchor' ) . style . display != 'none' && l ( 'CMTooltipArea' ) != null ) {
2176
2206
2177
- // Error checking
2178
- if ( CM . Disp . tooltipType == 'u' && ( typeof Game . UpgradesInStore [ CM . Disp . tooltipName ] === 'undefined' || typeof CM . Cache . Upgrades [ Game . UpgradesInStore [ CM . Disp . tooltipName ] . name ] === 'undefined' ) ) {
2179
- return ;
2180
- }
2181
- var price ;
2182
- var bonus ;
2183
- if ( CM . Disp . tooltipType == 'b' ) {
2184
- var target = '' ;
2185
- if ( Game . buyMode == 1 && Game . buyBulk == 10 ) {
2186
- target = 'Objects10' ;
2187
- price = CM . Cache [ target ] [ CM . Disp . tooltipName ] . price ;
2188
- }
2189
- else if ( Game . buyMode == 1 && Game . buyBulk == 100 ) {
2190
- target = 'Objects100' ;
2191
- price = CM . Cache [ target ] [ CM . Disp . tooltipName ] . price ;
2207
+ if ( CM . Disp . tooltipType == 'b' || CM . Disp . tooltipType == 'u' ) {
2208
+ // Error checking
2209
+ if ( CM . Disp . tooltipType == 'u' && ( typeof Game . UpgradesInStore [ CM . Disp . tooltipName ] === 'undefined' || typeof CM . Cache . Upgrades [ Game . UpgradesInStore [ CM . Disp . tooltipName ] . name ] === 'undefined' ) ) {
2210
+ return ;
2192
2211
}
2193
- else {
2194
- target = 'Objects' ;
2195
- price = Game . Objects [ CM . Disp . tooltipName ] . getPrice ( ) ;
2196
- }
2197
- bonus = CM . Cache [ target ] [ CM . Disp . tooltipName ] . bonus ;
2198
- if ( CM . Config . Tooltip == 1 && Game . buyMode == 1 ) {
2199
- l ( 'CMTooltipBorder' ) . className = CM . Disp . colorTextPre + CM . Cache [ target ] [ CM . Disp . tooltipName ] . color ;
2200
- l ( 'CMTooltipPP' ) . textContent = Beautify ( CM . Cache [ target ] [ CM . Disp . tooltipName ] . pp , 2 ) ;
2201
- l ( 'CMTooltipPP' ) . className = CM . Disp . colorTextPre + CM . Cache [ target ] [ CM . Disp . tooltipName ] . color ;
2202
- }
2203
- }
2204
- else { // Upgrades
2205
- bonus = CM . Cache . Upgrades [ Game . UpgradesInStore [ CM . Disp . tooltipName ] . name ] . bonus ;
2206
- price = Game . Upgrades [ Game . UpgradesInStore [ CM . Disp . tooltipName ] . name ] . getPrice ( ) ;
2207
- if ( CM . Config . Tooltip == 1 ) {
2208
- l ( 'CMTooltipBorder' ) . className = CM . Disp . colorTextPre + CM . Cache . Upgrades [ Game . UpgradesInStore [ CM . Disp . tooltipName ] . name ] . color ;
2209
- l ( 'CMTooltipPP' ) . textContent = Beautify ( CM . Cache . Upgrades [ Game . UpgradesInStore [ CM . Disp . tooltipName ] . name ] . pp , 2 ) ;
2210
- l ( 'CMTooltipPP' ) . className = CM . Disp . colorTextPre + CM . Cache . Upgrades [ Game . UpgradesInStore [ CM . Disp . tooltipName ] . name ] . color ;
2212
+ var price ;
2213
+ var bonus ;
2214
+ if ( CM . Disp . tooltipType == 'b' ) {
2215
+ var target = '' ;
2216
+ if ( Game . buyMode == 1 && Game . buyBulk == 10 ) {
2217
+ target = 'Objects10' ;
2218
+ price = CM . Cache [ target ] [ CM . Disp . tooltipName ] . price ;
2219
+ }
2220
+ else if ( Game . buyMode == 1 && Game . buyBulk == 100 ) {
2221
+ target = 'Objects100' ;
2222
+ price = CM . Cache [ target ] [ CM . Disp . tooltipName ] . price ;
2223
+ }
2224
+ else {
2225
+ target = 'Objects' ;
2226
+ price = Game . Objects [ CM . Disp . tooltipName ] . getPrice ( ) ;
2227
+ }
2228
+ bonus = CM . Cache [ target ] [ CM . Disp . tooltipName ] . bonus ;
2229
+ if ( CM . Config . Tooltip == 1 && Game . buyMode == 1 ) {
2230
+ l ( 'CMTooltipBorder' ) . className = CM . Disp . colorTextPre + CM . Cache [ target ] [ CM . Disp . tooltipName ] . color ;
2231
+ l ( 'CMTooltipPP' ) . textContent = Beautify ( CM . Cache [ target ] [ CM . Disp . tooltipName ] . pp , 2 ) ;
2232
+ l ( 'CMTooltipPP' ) . className = CM . Disp . colorTextPre + CM . Cache [ target ] [ CM . Disp . tooltipName ] . color ;
2233
+ }
2211
2234
}
2212
- }
2213
- if ( CM . Config . Tooltip == 1 && ( CM . Disp . tooltipType != 'b' || Game . buyMode == 1 ) ) {
2214
- l ( 'CMTooltipIncome' ) . textContent = Beautify ( bonus , 2 ) ;
2215
-
2216
- var increase = Math . round ( bonus / Game . cookiesPs * 10000 ) ;
2217
- if ( isFinite ( increase ) && increase != 0 ) {
2218
- l ( 'CMTooltipIncome' ) . textContent += ' (' + ( increase / 100 ) + '% of income)' ;
2235
+ else { // Upgrades
2236
+ bonus = CM . Cache . Upgrades [ Game . UpgradesInStore [ CM . Disp . tooltipName ] . name ] . bonus ;
2237
+ price = Game . Upgrades [ Game . UpgradesInStore [ CM . Disp . tooltipName ] . name ] . getPrice ( ) ;
2238
+ if ( CM . Config . Tooltip == 1 ) {
2239
+ l ( 'CMTooltipBorder' ) . className = CM . Disp . colorTextPre + CM . Cache . Upgrades [ Game . UpgradesInStore [ CM . Disp . tooltipName ] . name ] . color ;
2240
+ l ( 'CMTooltipPP' ) . textContent = Beautify ( CM . Cache . Upgrades [ Game . UpgradesInStore [ CM . Disp . tooltipName ] . name ] . pp , 2 ) ;
2241
+ l ( 'CMTooltipPP' ) . className = CM . Disp . colorTextPre + CM . Cache . Upgrades [ Game . UpgradesInStore [ CM . Disp . tooltipName ] . name ] . color ;
2242
+ }
2219
2243
}
2244
+ if ( CM . Config . Tooltip == 1 && ( CM . Disp . tooltipType != 'b' || Game . buyMode == 1 ) ) {
2245
+ l ( 'CMTooltipIncome' ) . textContent = Beautify ( bonus , 2 ) ;
2246
+
2247
+ var increase = Math . round ( bonus / Game . cookiesPs * 10000 ) ;
2248
+ if ( isFinite ( increase ) && increase != 0 ) {
2249
+ l ( 'CMTooltipIncome' ) . textContent += ' (' + ( increase / 100 ) + '% of income)' ;
2250
+ }
2220
2251
2221
- var timeColor = CM . Disp . GetTimeColor ( price , ( Game . cookies + CM . Disp . GetWrinkConfigBank ( ) ) , CM . Disp . GetCPS ( ) ) ;
2222
- l ( 'CMTooltipTime' ) . textContent = timeColor . text ;
2223
- l ( 'CMTooltipTime' ) . className = CM . Disp . colorTextPre + timeColor . color ;
2224
- }
2225
-
2226
- if ( CM . Config . ToolWarnCaut == 1 ) {
2227
- var warn = CM . Cache . Lucky ;
2228
- if ( CM . Config . ToolWarnCautBon == 1 ) {
2229
- var bonusNoFren = bonus ;
2230
- bonusNoFren /= CM . Sim . getCPSBuffMult ( ) ;
2231
- warn += ( ( bonusNoFren * 60 * 15 ) / 0.15 ) ;
2252
+ var timeColor = CM . Disp . GetTimeColor ( price , ( Game . cookies + CM . Disp . GetWrinkConfigBank ( ) ) , CM . Disp . GetCPS ( ) ) ;
2253
+ l ( 'CMTooltipTime' ) . textContent = timeColor . text ;
2254
+ l ( 'CMTooltipTime' ) . className = CM . Disp . colorTextPre + timeColor . color ;
2232
2255
}
2233
- var caut = warn * 7 ;
2234
- var amount = ( Game . cookies + CM . Disp . GetWrinkConfigBank ( ) ) - price ;
2235
- if ( ( amount < warn || amount < caut ) && ( CM . Disp . tooltipType != 'b' || Game . buyMode == 1 ) ) {
2236
- if ( CM . Config . ToolWarnCautPos == 0 ) {
2237
- CM . Disp . TooltipWarnCaut . style . right = '0px' ;
2238
- }
2239
- else {
2240
- CM . Disp . TooltipWarnCaut . style . top = ( l ( 'tooltip' ) . offsetHeight ) + 'px' ;
2241
- }
2242
- CM . Disp . TooltipWarnCaut . style . width = ( l ( 'tooltip' ) . offsetWidth - 6 ) + 'px' ;
2243
-
2244
- if ( amount < warn ) {
2245
- l ( 'CMDispTooltipWarn' ) . style . display = '' ;
2246
- l ( 'CMDispTooltipWarnText' ) . textContent = Beautify ( warn - amount ) + ' (' + CM . Disp . FormatTime ( ( warn - amount ) / CM . Disp . GetCPS ( ) ) + ')' ;
2247
- l ( 'CMDispTooltipCaut' ) . style . display = '' ;
2248
- l ( 'CMDispTooltipCautText' ) . textContent = Beautify ( caut - amount ) + ' (' + CM . Disp . FormatTime ( ( caut - amount ) / CM . Disp . GetCPS ( ) ) + ')' ;
2256
+
2257
+ if ( CM . Config . ToolWarnCaut == 1 ) {
2258
+ var warn = CM . Cache . Lucky ;
2259
+ if ( CM . Config . ToolWarnCautBon == 1 ) {
2260
+ var bonusNoFren = bonus ;
2261
+ bonusNoFren /= CM . Sim . getCPSBuffMult ( ) ;
2262
+ warn += ( ( bonusNoFren * 60 * 15 ) / 0.15 ) ;
2249
2263
}
2250
- else if ( amount < caut ) {
2251
- l ( 'CMDispTooltipCaut' ) . style . display = '' ;
2252
- l ( 'CMDispTooltipCautText' ) . textContent = Beautify ( caut - amount ) + ' (' + CM . Disp . FormatTime ( ( caut - amount ) / CM . Disp . GetCPS ( ) ) + ')' ;
2253
- l ( 'CMDispTooltipWarn' ) . style . display = 'none' ;
2264
+ var caut = warn * 7 ;
2265
+ var amount = ( Game . cookies + CM . Disp . GetWrinkConfigBank ( ) ) - price ;
2266
+ if ( ( amount < warn || amount < caut ) && ( CM . Disp . tooltipType != 'b' || Game . buyMode == 1 ) ) {
2267
+ if ( CM . Config . ToolWarnCautPos == 0 ) {
2268
+ CM . Disp . TooltipWarnCaut . style . right = '0px' ;
2269
+ }
2270
+ else {
2271
+ CM . Disp . TooltipWarnCaut . style . top = ( l ( 'tooltip' ) . offsetHeight ) + 'px' ;
2272
+ }
2273
+ CM . Disp . TooltipWarnCaut . style . width = ( l ( 'tooltip' ) . offsetWidth - 6 ) + 'px' ;
2274
+
2275
+ if ( amount < warn ) {
2276
+ l ( 'CMDispTooltipWarn' ) . style . display = '' ;
2277
+ l ( 'CMDispTooltipWarnText' ) . textContent = Beautify ( warn - amount ) + ' (' + CM . Disp . FormatTime ( ( warn - amount ) / CM . Disp . GetCPS ( ) ) + ')' ;
2278
+ l ( 'CMDispTooltipCaut' ) . style . display = '' ;
2279
+ l ( 'CMDispTooltipCautText' ) . textContent = Beautify ( caut - amount ) + ' (' + CM . Disp . FormatTime ( ( caut - amount ) / CM . Disp . GetCPS ( ) ) + ')' ;
2280
+ }
2281
+ else if ( amount < caut ) {
2282
+ l ( 'CMDispTooltipCaut' ) . style . display = '' ;
2283
+ l ( 'CMDispTooltipCautText' ) . textContent = Beautify ( caut - amount ) + ' (' + CM . Disp . FormatTime ( ( caut - amount ) / CM . Disp . GetCPS ( ) ) + ')' ;
2284
+ l ( 'CMDispTooltipWarn' ) . style . display = 'none' ;
2285
+ }
2286
+ else {
2287
+ l ( 'CMDispTooltipWarn' ) . style . display = 'none' ;
2288
+ l ( 'CMDispTooltipCaut' ) . style . display = 'none' ;
2289
+ }
2254
2290
}
2255
2291
else {
2256
2292
l ( 'CMDispTooltipWarn' ) . style . display = 'none' ;
2257
2293
l ( 'CMDispTooltipCaut' ) . style . display = 'none' ;
2258
2294
}
2259
2295
}
2260
- else {
2261
- l ( 'CMDispTooltipWarn' ) . style . display = 'none' ;
2262
- l ( 'CMDispTooltipCaut' ) . style . display = 'none' ;
2296
+ }
2297
+ else { // Grimoire
2298
+ l ( 'CMDispTooltipWarn' ) . style . display = 'none' ;
2299
+ l ( 'CMDispTooltipCaut' ) . style . display = 'none' ;
2300
+
2301
+ var minigame = Game . Objects [ 'Wizard tower' ] . minigame ;
2302
+ var spellCost = minigame . getSpellCost ( minigame . spellsById [ CM . Disp . tooltipName ] ) ;
2303
+
2304
+ if ( CM . Config . Tooltip == 1 && spellCost <= minigame . magicM ) {
2305
+ l ( 'CMTooltipArea' ) . innerHTML = '' ;
2306
+
2307
+ l ( 'tooltip' ) . firstChild . style . paddingBottom = '4px' ;
2308
+ var tooltip = document . createElement ( 'div' ) ;
2309
+ tooltip . style . border = '1px solid' ;
2310
+ tooltip . style . padding = '4px' ;
2311
+ tooltip . style . margin = '0px -4px' ;
2312
+ tooltip . id = 'CMTooltipBorder' ;
2313
+ tooltip . className = CM . Disp . colorTextPre + CM . Disp . colorGray ;
2314
+
2315
+ var header = function ( text ) {
2316
+ var div = document . createElement ( 'div' ) ;
2317
+ div . style . fontWeight = 'bold' ;
2318
+ div . className = CM . Disp . colorTextPre + CM . Disp . colorBlue ;
2319
+ div . textContent = text ;
2320
+ return div ;
2321
+ }
2322
+
2323
+ tooltip . appendChild ( header ( 'Time Left' ) ) ;
2324
+ var time = document . createElement ( 'div' ) ;
2325
+ time . id = 'CMTooltipTime' ;
2326
+ tooltip . appendChild ( time ) ;
2327
+ var timeColor = CM . Disp . GetTimeColor ( spellCost , minigame . magic , undefined , CM . Disp . CalculateGrimoireRefillTime ( minigame . magic , minigame . magicM , spellCost ) ) ;
2328
+ time . textContent = timeColor . text ;
2329
+ time . className = CM . Disp . colorTextPre + timeColor . color ;
2330
+
2331
+ if ( spellCost <= minigame . magic ) {
2332
+ tooltip . appendChild ( header ( 'Recover Time' ) ) ;
2333
+ var recover = document . createElement ( 'div' ) ;
2334
+ recover . id = 'CMTooltipRecover' ;
2335
+ tooltip . appendChild ( recover ) ;
2336
+ var recoverColor = CM . Disp . GetTimeColor ( minigame . magic , Math . max ( 0 , minigame . magic - spellCost ) , undefined , CM . Disp . CalculateGrimoireRefillTime ( Math . max ( 0 , minigame . magic - spellCost ) , minigame . magicM , minigame . magic ) ) ;
2337
+ recover . textContent = recoverColor . text ;
2338
+ recover . className = CM . Disp . colorTextPre + recoverColor . color ;
2339
+ }
2340
+
2341
+ l ( 'CMTooltipArea' ) . appendChild ( tooltip ) ;
2263
2342
}
2264
2343
}
2265
2344
}
@@ -2460,7 +2539,15 @@ CM.ReplaceNative = function() {
2460
2539
CM . Backup . UpdateSpecial ( ) ;
2461
2540
}
2462
2541
}
2463
-
2542
+
2543
+ // Probably better to load per minigame
2544
+ CM . Backup . scriptLoaded = Game . scriptLoaded ;
2545
+ Game . scriptLoaded = function ( who , script ) {
2546
+ CM . Backup . scriptLoaded ( who , script ) ;
2547
+ CM . Disp . AddTooltipGrimoire ( )
2548
+ CM . ReplaceNativeGrimoire ( ) ;
2549
+ }
2550
+
2464
2551
CM . Backup . RebuildUpgrades = Game . RebuildUpgrades ;
2465
2552
Game . RebuildUpgrades = function ( ) {
2466
2553
CM . Backup . RebuildUpgrades ( ) ;
@@ -2498,6 +2585,40 @@ CM.ReplaceNative = function() {
2498
2585
}
2499
2586
}
2500
2587
2588
+ CM . ReplaceNativeGrimoire = function ( ) {
2589
+ CM . ReplaceNativeGrimoireLaunch ( ) ;
2590
+ CM . ReplaceNativeGrimoireDraw ( ) ;
2591
+ }
2592
+
2593
+ CM . ReplaceNativeGrimoireLaunch = function ( ) {
2594
+ if ( ! CM . HasReplaceNativeGrimoireLaunch && Game . Objects [ 'Wizard tower' ] . minigameLoaded ) {
2595
+ var minigame = Game . Objects [ 'Wizard tower' ] . minigame ;
2596
+ CM . Backup . GrimoireLaunch = minigame . launch ;
2597
+ eval ( 'CM.Backup.GrimoireLaunchMod = ' + minigame . launch . toString ( ) . split ( '=this' ) . join ( '= Game.Objects[\'Wizard tower\'].minigame' ) ) ;
2598
+ Game . Objects [ 'Wizard tower' ] . minigame . launch = function ( ) {
2599
+ CM . Backup . GrimoireLaunchMod ( ) ;
2600
+ CM . Disp . AddTooltipGrimoire ( ) ;
2601
+ CM . HasReplaceNativeGrimoireDraw = false ;
2602
+ CM . ReplaceNativeGrimoireDraw ( ) ;
2603
+ }
2604
+ CM . HasReplaceNativeGrimoireLaunch = true ;
2605
+ }
2606
+ }
2607
+
2608
+ CM . ReplaceNativeGrimoireDraw = function ( ) {
2609
+ if ( ! CM . HasReplaceNativeGrimoireDraw && Game . Objects [ 'Wizard tower' ] . minigameLoaded ) {
2610
+ var minigame = Game . Objects [ 'Wizard tower' ] . minigame ;
2611
+ CM . Backup . GrimoireDraw = minigame . draw ;
2612
+ Game . Objects [ 'Wizard tower' ] . minigame . draw = function ( ) {
2613
+ CM . Backup . GrimoireDraw ( ) ;
2614
+ if ( minigame . magic < minigame . magicM ) {
2615
+ minigame . magicBarTextL . innerHTML += ' (' + CM . Disp . FormatTime ( CM . Disp . CalculateGrimoireRefillTime ( minigame . magic , minigame . magicM , minigame . magicM ) ) + ')' ;
2616
+ }
2617
+ }
2618
+ CM . HasReplaceNativeGrimoireDraw = true ;
2619
+ }
2620
+ }
2621
+
2501
2622
CM . Loop = function ( ) {
2502
2623
if ( CM . Disp . lastAscendState != Game . OnAscend ) {
2503
2624
CM . Disp . lastAscendState = Game . OnAscend ;
@@ -2604,9 +2725,11 @@ CM.DelayInit = function() {
2604
2725
CM . Disp . CreateTooltip ( 'ChoEggTooltipPlaceholder' , 'The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamind slot, selling all buildings with Earth Shatterer aura, and then buying Chocolate egg' , '360px' ) ;
2605
2726
CM . Disp . CreateTooltipWarnCaut ( ) ;
2606
2727
CM . Disp . AddTooltipBuild ( ) ;
2728
+ CM . Disp . AddTooltipGrimoire ( ) ;
2607
2729
CM . Disp . AddWrinklerAreaDetect ( ) ;
2608
2730
CM . Cache . InitCookiesDiff ( ) ;
2609
2731
CM . ReplaceNative ( ) ;
2732
+ CM . ReplaceNativeGrimoire ( ) ;
2610
2733
Game . CalculateGains ( ) ;
2611
2734
CM . LoadConfig ( ) ; // Must be after all things are created!
2612
2735
CM . Disp . lastAscendState = Game . OnAscend ;
@@ -2619,6 +2742,9 @@ CM.DelayInit = function() {
2619
2742
Game . Win ( 'Third-party' ) ;
2620
2743
}
2621
2744
2745
+ CM . HasReplaceNativeGrimoireLaunch = false ;
2746
+ CM . HasReplaceNativeGrimoireDraw = false ;
2747
+
2622
2748
CM . ConfigDefault = { BotBar : 1 , TimerBar : 1 , TimerBarPos : 0 , BuildColor : 1 , BulkBuildColor : 0 , UpBarColor : 1 , CalcWrink : 0 , CPSMode : 1 , AvgCPSHist : 0 , AvgClicksHist : 0 , ToolWarnCautBon : 0 , Flash : 1 , Sound : 1 , Volume : 100 , GCSoundURL : 'http://freesound.org/data/previews/66/66717_931655-lq.mp3' , SeaSoundURL : 'http://www.freesound.org/data/previews/121/121099_2193266-lq.mp3' , GCTimer : 1 , Title : 1 , Favicon : 1 , Tooltip : 1 , TooltipAmor : 0 , ToolWarnCaut : 1 , ToolWarnCautPos : 1 , ToolWrink : 1 , Stats : 1 , UpStats : 1 , TimeFormat : 0 , SayTime : 1 , Scale : 2 , StatsPref : { Lucky : 1 , Chain : 1 , Prestige : 1 , Wrink : 1 , Sea : 1 , Misc : 1 } , Colors : { Blue : '#4bb8f0' , Green : '#00ff00' , Yellow : '#ffff00' , Orange : '#ff7f00' , Red : '#ff0000' , Purple : '#ff00ff' , Gray : '#b3b3b3' , Pink : '#ff1493' , Brown : '#8b4513' } } ;
2623
2749
CM . ConfigPrefix = 'CMConfig' ;
2624
2750
0 commit comments