forked from Trimps/Trimps.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdates.js
More file actions
4745 lines (4569 loc) · 242 KB
/
updates.js
File metadata and controls
4745 lines (4569 loc) · 242 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Trimps
Copyright (C) 2016 Zach Hood
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program (if you are reading this on the original
author's website, you can find a copy at
<trimps.github.io/license.txt>). If not, see
<http://www.gnu.org/licenses/>. */
var customUp;
var tooltipUpdateFunction = "";
var lastMousePos = [];
var lastTooltipFrom = "";
var onShift;
var openTooltip = null;
//"onmouseover="tooltip('*TOOLTIP_TITLE*', 'customText', event, '*TOOLTIP_TEXT*');" onmouseout="tooltip('hide')""
//in the event of what == 'confirm', numCheck works as a Title! Exciting, right?
function tooltip(what, isItIn, event, textString, attachFunction, numCheck, renameBtn, noHide, hideCancel, ignoreShift) { //Now 20% less menacing. Work in progress.
if (!game.options.menu.bigPopups.enabled && (
what == "The Improbability" ||
(what == "Corruption" && game.global.highestLevelCleared >= 199) ||
(what == "The Spire" && game.global.highestLevelCleared >= 219) ||
(what == "The Magma" && game.global.highestLevelCleared >= 249)
)){
return;
}
checkAlert(what, isItIn);
if (game.global.lockTooltip && event != 'update') return;
if (game.global.lockTooltip && isItIn && event == 'update') return;
var elem = document.getElementById("tooltipDiv");
swapClass("tooltipExtra", "tooltipExtraNone", elem);
document.getElementById('tipText').className = "";
var ondisplay = null; // if non-null, called after the tooltip is displayed
openTooltip = null;
if (what == "hide"){
elem.style.display = "none";
tooltipUpdateFunction = "";
onShift = null;
return;
}
if ((event != 'update' || isItIn) && !game.options.menu.tooltips.enabled && !shiftPressed && what != "Well Fed" && what != 'Perk Preset' && what != 'Activate Portal' && !ignoreShift) {
var whatU = what, isItInU = isItIn, eventU = event, textStringU = textString, attachFunctionU = attachFunction, numCheckU = numCheck, renameBtnU = renameBtn, noHideU = noHide;
var newFunction = function () {
tooltip(whatU, isItInU, eventU, textStringU, attachFunctionU, numCheckU, renameBtnU, noHideU);
};
onShift = newFunction;
return;
}
if (event != "update"){
var whatU = what, isItInU = isItIn, eventU = event, textStringU = textString, attachFunctionU = attachFunction, numCheckU = numCheck, renameBtnU = renameBtn, noHideU = noHide;
var newFunction = function () {
tooltip(whatU, isItInU, eventU, textStringU, attachFunctionU, numCheckU, renameBtnU, noHideU);
};
tooltipUpdateFunction = newFunction;
}
var tooltipText;
var costText = "";
var toTip;
var titleText;
var tip2 = false;
var noExtraCheck = false;
if (isItIn !== null && isItIn != "maps" && isItIn != "customText" && isItIn != "dailyStack" && isItIn != "advMaps"){
toTip = game[isItIn];
toTip = toTip[what];
if (typeof toTip === 'undefined') console.log(what);
else {
tooltipText = toTip.tooltip;
if (typeof tooltipText === 'function') tooltipText = tooltipText();
if (typeof toTip.cost !== 'undefined') costText = addTooltipPricing(toTip, what, isItIn);
}
}
if (isItIn == "advMaps"){
var advTips = {
Loot: "This slider allows you to fine tune the map Loot modifier. Moving this slider from left to right will guarantee more loot from the map, but increase the cost.",
Size: "This slider allows you to fine tune the map Size modifier. Moving this slider from left to right will guarantee a smaller map, but increase the cost.",
Difficulty: "This slider allows you to fine tune the map Difficulty modifier. Moving this slider from left to right will guarantee an easier map, but increase the cost.",
Biome: "If you're looking to farm something specific, you can select the biome here. Anything other than random will increase the cost of the map.",
get Special_Modifier() {
var text = "<p>Select a special modifier to add to your map from the drop-down below! You can only add one of these to each map. The following bonuses are currently available:</p><ul>"
for (var item in mapSpecialModifierConfig){
var bonusItem = mapSpecialModifierConfig[item];
if (game.global.highestLevelCleared + 1 < bonusItem.unlocksAt){
text += "<li><b>Next modifier unlocks at Z" + bonusItem.unlocksAt + "</b></li>";
break;
}
text += "<li><b>" + bonusItem.name + " (" + bonusItem.abv + ")</b> - " + bonusItem.description + "</li>";
}
return text;
},
Show_Hide_Map_Config: "Click this to collapse/expand the map configuration options.",
Save_Map_Settings: "Click this to save your current map configuration settings to your currently selected preset. These settings will load by default every time you come in to the map chamber or select this preset.",
Reset_Map_Settings: "Click this to reset all settings to their default positions. This will not clear your saved setting, which will still be loaded next time you enter the map chamber.",
Extra_Zones: "<p>Create a map up to 10 Zones higher than your current Zone number. This map will gain +10% loot per extra level (compounding), and can drop Prestige upgrades higher than you could get from a world level map.</p><p>You can only use this setting when creating a max level map.</p>",
Perfect_Sliders: "<p>This option takes all of the RNG out of map generation! If sliders are maxxed and the box is checked, you have a 100% chance to get a perfect roll on Loot, Size, and Difficulty.</p><p>You can only choose this setting if the sliders for Loot, Size, and Difficulty are at the max.</p>",
Map_Preset: "You can save up to 3 different map configurations to switch between at will. The most recently selected setting will load each time you enter your map chamber."
}
if (what == "Special Modifier" && game.global.highestLevelCleared >= 149) {
swapClass("tooltipExtra", "tooltipExtraLg", elem);
renameBtn = "forceLeft";
}
noExtraCheck = true;
tooltipText = advTips[what.replace(/ /g, '_').replace(/\//g, '_')];
}
if (isItIn == "dailyStack"){
tooltipText = dailyModifiers[what].stackDesc(game.global.dailyChallenge[what].strength, game.global.dailyChallenge[what].stacks);
costText = "";
what = what[0].toUpperCase() + what.substr(1)
}
if (what == "Confirm Purchase"){
if (attachFunction == "purchaseImport()" && !boneTemp.selectedImport) return;
if (game.options.menu.boneAlerts.enabled == 0 && numCheck){
eval(attachFunction);
return;
}
var btnText = "Make Purchase";
if (numCheck && game.global.b < numCheck){
if (typeof kongregate === 'undefined') return;
tooltipText = "You can't afford this bonus. Would you like to visit the shop?";
attachFunction = "showPurchaseBones()";
btnText = "Visit Shop";
}
else
tooltipText = textString;
costText += '<div class="maxCenter"><div id="confirmTooltipBtn" class="btn btn-info" onclick="' + attachFunction + '; cancelTooltip()">' + btnText + '</div><div class="btn btn-info" onclick="cancelTooltip()">Cancel</div></div>';
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Trimps Info"){
var kongMode = (document.getElementById('boneBtn') !== null);
var text = '<div class="trimpsInfoPopup">Need help, found a bug or just want to talk about Trimps? Check out the <a href="https://www.reddit.com/r/trimps" target="_blank">/r/Trimps SubReddit</a>';
if (kongMode) text += ' or the <a href="https://www.kongregate.com/forums/11405-trimps" target="_blank">Kongregate Forums</a>.<br/><br/>';
else text +=' or come hang out in the new <a href="https://discord.gg/kSpNHte" target="_blank">Trimps Official Discord</a>!<br/><br/>';
text += ' If you want to read about or discuss the finer details of Trimps mechanics, check out the <a href="https://trimps.wikia.com/wiki/Trimps_Wiki" target="_blank">community-created Trimps Wiki!</a><br/><br/>';
if (kongMode) text += ' If you need to contact the developer for any reason, <a target="_blank" href="https://www.kongregate.com/accounts/Greensatellite/private_messages?focus=true">send a private message to GreenSatellite</a> on Kongregate.';
else text += ' If you need to contact the developer for any reason, <a href="https://www.reddit.com/message/compose/?to=Brownprobe" target="_blank">click here to send a message on Reddit</a> or find Greensatellite in the Trimps Discord.<hr/><br/>' + "If you would like to make a donation to help support the development of Trimps, you can now do so with PayPal! If you want to contribute but can't afford a donation, you can still give back by joining the community and sharing your feedback or helping others. Thank you either way, you're awesome! <form id='donateForm' style='text-align: center' action='https://www.paypal.com/cgi-bin/webscr' method='post' target='_blank'><input type='hidden' name='cmd' value='_s-xclick'><input type='hidden' name='hosted_button_id' value='MGFEJS3VVJG6U'><input type='image' src='https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif' border='0' name='submit' alt='PayPal - The safer, easier way to pay online!'><img alt='' border='0' src='https://www.paypalobjects.com/en_US/i/scr/pixel.gif' width='1' height='1'></form>";
text += '</div>';
tooltipText = text;
costText = '<div class="btn btn-info" onclick="cancelTooltip()">Close</div>';
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
noExtraCheck = true;
}
if (what == "Fluffy"){
if (event == 'update'){
//clicked
game.global.lockTooltip = true;
elem.style.top = "25%";
elem.style.left = "25%";
swapClass('tooltipExtra', 'tooltipExtraLg', elem);
var fluffyTip = Fluffy.tooltip(true);
tooltipText = "<div id='fluffyTooltipTopContainer'>" + fluffyTip[0] + "</div>";
tooltipText += "<div id='fluffyLevelBreakdownContainer' class='niceScroll'>" + fluffyTip[1] + "</div>";
costText = '<div class="btn btn-danger" onclick="cancelTooltip()">Close</div>';
openTooltip = "Fluffy";
setTimeout(Fluffy.refreshTooltip, 1000);
ondisplay = function(){
verticalCenterTooltip(false, true);
};
}
else {
//mouseover
tooltipText = Fluffy.tooltip();
costText = "Click for more detailed info"
}
}
if (what == "Scryer Formation"){
tooltipText = "<p>Trimps lose half of their attack, health and block but gain 2x resources from loot (not including Helium) and have a chance to find Dark Essence above Z180 in the world. This formation must be active for the entire fight to receive any bonus from enemies, and must be active for the entire map to earn a bonus from a Cache. (Hotkeys: S or 5)</p>";
if (game.global.formation == 4){
if (!isScryerBonusActive()) tooltipText += "<p>You recently switched to Scryer and will <b>not</b> earn a bonus from this enemy.</p>";
else tooltipText += "<p>You will earn a bonus from this enemy!</p>";
if (game.global.mapsActive){
var currentMap = getCurrentMapObject();
if (currentMap.bonus && mapSpecialModifierConfig[currentMap.bonus].cache){
if (game.global.canScryCache) tooltipText += "<p>You will earn a bonus from the Cache at the end of this map!</p>";
else tooltipText += "<p>You completed some of this map outside of Scryer, and will <b>not</b> earn a bonus from the Cache.</p>";
}
if (game.global.voidBuff && game.talents.scry2.purchased){
if (game.global.canScryCache) tooltipText += "<p>You will earn bonus Helium at the end of this map from Scryhard II!</p>";
else tooltipText += "<p>You completed some of this map outside of Scryer, and will <b>not</b> earn a bonus to Helium from Scryhard II</p>";
}
}
}
if (game.global.world >= 180){
var essenceRemaining = countRemainingEssenceDrops();
tooltipText += "<p><b>" + essenceRemaining + " remaining " + ((essenceRemaining == 1) ? "enemy in your current Zone is" : "enemies in your current Zone are") + " holding Dark Essence.</b></p>"
}
costText = "";
}
if (what == "First Amalgamator"){
tooltipText = "<p><b>You found your first Amalgamator! You can view this tooltip again and track how many Amalgamators you currently have under 'Jobs'.</b></p>";
tooltipText += game.jobs.Amalgamator.tooltip;
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>Thanks for the help, tooltip, but you can go now.</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
noExtraCheck = true;
ondisplay = function () { verticalCenterTooltip() };
}
if (what == "Empowerments of Nature"){
var active = getEmpowerment();
if (!active) return;
var emp = game.empowerments[active];
if (typeof emp.description === 'undefined') return;
var lvlsLeft = ((5 - ((game.global.world - 1) % 5)) + (game.global.world - 1)) + 1;
tooltipText = "<p>The " + active + " Empowerment is currently active!</p><p>" + emp.description() + "</p><p>This Empowerment will end on Z" + lvlsLeft + ", at which point you'll be able to fight a " + getEmpowerment(null, true) + " enemy to earn a Token of " + active + ".</p>";
costText = "";
}
if (what == "Finish Daily"){
var value = getDailyHeliumValue(countDailyWeight()) / 100;
var reward = game.resources.helium.owned + game.stats.spentOnWorms.value;
if (reward > 0) reward = Math.floor(reward * value);
tooltipText = "Clicking <b>Finish</b> below will end your daily challenge and you will be unable to attempt it again. You will earn <b>" + prettify(reward) + " extra Helium!</b>";
costText = '<div class="maxCenter"><div id="confirmTooltipBtn" class="btn btn-info" onclick="abandonChallenge(); cancelTooltip()">Finish</div><div class="btn btn-danger" onclick="cancelTooltip()">Cancel</div></div>';
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Switch Daily"){
var daysUntilReset = Math.floor(7 + textString);
tooltipText = "Click to view " + ((textString == 0) ? "today" : dayOfWeek(getDailyTimeString(textString, false, true))) + "s challenge, which resets in less than " + daysUntilReset + " day" + ((daysUntilReset == 1) ? "" : "s") + ".";
costText = "";
}
if (what == "Decay"){
var decayedAmt = ((1 - Math.pow(0.995, game.challenges.Decay.stacks)) * 100).toFixed(2);
tooltipText = "Things are quickly becoming tougher. Gathering, looting, and Trimp attack are reduced by " + decayedAmt + "%.";
costText = "";
}
if (what == "Heirloom"){
//attachFunction == location, numCheck == index
tooltipUpdateFunction = "";
tooltipText = displaySelectedHeirloom(false, 0, true, numCheck, attachFunction);
costText = "";
renameBtn = what;
what = "";
if (getSelectedHeirloom(numCheck, attachFunction).rarity == 8){
ondisplay = function() {
document.getElementById('tooltipHeirloomIcon').style.animationDelay = "-" + ((new Date().getTime() / 1000) % 30).toFixed(1) + "s";
}
}
swapClass("tooltipExtra", "tooltipExtraHeirloom", elem);
noExtraCheck = true;
}
if (what == "Respec"){
tooltipText = "You can respec your perks once per portal. Clicking cancel after clicking this button will not consume your respec.";
costText = "";
}
if (what == "Well Fed"){
var tBonus = 50;
if (game.talents.turkimp4.purchased) tBonus = 100;
else if (game.talents.turkimp3.purchased) tBonus = 75;
tooltipText = "That Turkimp was delicious, and you have leftovers. If you set yourself to gather Food, Wood, or Metal while this buff is active, you can share with your workers to increase their gather speed by " + tBonus + "%";
costText = "";
}
if (what == "Geneticistassist"){
tooltipText = "I'm your Geneticistassist! I'll hire and fire Geneticists until your total breed time is as close as possible to the target time you choose. I will fire a Farmer, Lumberjack, or Miner at random if there aren't enough workspaces, I will never spend more than 1% of your food on a Geneticist, and you can customize my target time options in Settings <b>or by holding Ctrl and clicking me</b>. I have uploaded myself to your portal and will never leave you.";
costText = "";
}
if (what == "Welcome"){
tooltipText = "Welcome to Trimps! This game saves using Local Storage in your browser. Clearing your cookies or browser settings will cause your save to disappear! Please make sure you regularly back up your save file by either using the 'Export' button in the bar below or the 'Online Saving' option under 'Settings'.<br/><br/><b>Chrome and Firefox are currently the only fully supported browsers.</b><br/><br/>";
if (document.getElementById('boneBtn') !== null){
tooltipText += "<b style='color: red'>Notice: Did you expect to see your save here?</b><br/>If this is your first time playing since November 13th 2017, check <a target='_blank' href='http://trimps.github.io'>http://trimps.github.io</a> (make sure you go to http, not https), and see if it's there. For more information, see <a target='_blank' href='http://www.kongregate.com/forums/11406-general-discussion/topics/941201-if-your-save-is-missing-after-november-13th-click-here?page=1#posts-11719541'>This Forum Thread</a>.<br/><br/>";
}
tooltipText += "<b>Would you like to enable online saving before you start?</b>";
game.global.lockTooltip = true;
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip(); toggleSetting(\"usePlayFab\");'>Enable Online Saving</div><div class='btn btn-danger' onclick='cancelTooltip()'>Don't Enable</div></div>";
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Trustworthy Trimps"){
tooltipText = textString;
game.global.lockTooltip = true;
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>Sweet, thanks.</div></div>";
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Unequip Heirloom"){
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
costText = "<div class='maxCenter'>";
tooltipText = "<p>You have no more room to carry another Heirloom, ";
if (game.global.maxCarriedHeirlooms > game.heirlooms.values.length){
tooltipText += "and you've already purchased the maximum amount of slots.</p><p>Would you like to leave this Heirloom equipped "
}
else if (game.global.nullifium < getNextCarriedCost()){
tooltipText += "and don't have enough Nullifium to purchase another Carried slot.</p><p>Would you like to leave this Heirloom equipped "
}
else {
tooltipText += "but you do have enough Nullifium to purchase another Carried slot!</p><p>Would you like to purchase another Carried slot, leave this Heirloom equipped, ";
costText += "<div class='btn btn-success' onclick='cancelTooltip(); addCarried(true); unequipHeirloom();'>Buy a Slot (" + getNextCarriedCost() + " Nu)</div>";
}
tooltipText += "or put it in Temporary Storage? <b>If you use your Portal while this Heirloom is in Temporary Storage, it will be recycled!</b></p>";
costText += "<div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>Leave it equipped</div><div class='btn btn-danger' onclick='cancelTooltip(); unequipHeirloom(null, \"heirloomsExtra\");'>Place in Temporary</div></div>";
}
if (what == "Configure AutoStructure"){
tooltipText = "<p>Here you can choose which structures will be automatically purchased when AutoStructure is toggled on. Check a box to enable the automatic purchasing of that structure, set the dropdown to specify the cost-to-resource % that the structure should be purchased below, and set the 'Up To:' box to the maximum number of that structure you'd like purchased <b>(0 for no limit)</b>. For example, setting the dropdown to 10% and the 'Up To:' box to 50 for 'House' will cause a House to be automatically purchased whenever the costs of the next house are less than 10% of your Food, Metal, and Wood, as long as you have less than 50 houses.</p><table id='autoStructureConfigTable'><tbody><tr>";
var count = 0;
for (var item in game.buildings){
var building = game.buildings[item];
if (!building.AP) continue;
if (count != 0 && count % 2 == 0) tooltipText += "</tr><tr>";
var setting = game.global.autoStructureSetting[item];
var selectedPerc = (setting) ? setting.value : 0.1;
var checkbox = buildNiceCheckbox('structConfig' + item, 'autoCheckbox', (setting && setting.enabled));
var options = "<option value='0.1'" + ((selectedPerc == 0.1) ? " selected" : "") + ">0.1%</option><option value='1'" + ((selectedPerc == 1) ? " selected" : "") + ">1%</option><option value='5'" + ((selectedPerc == 5) ? " selected" : "") + ">5%</option><option value='10'" + ((selectedPerc == 10) ? " selected" : "") + ">10%</option><option value='25'" + ((selectedPerc == 25) ? " selected" : "") + ">25%</option>";
tooltipText += "<td><div class='row'><div class='col-xs-5' style='padding-right: 5px'>" + checkbox + " <span>" + item + "</span></div><div style='text-align: center; padding-left: 0px;' class='col-xs-2'><select id='structSelect" + item + "'>" + options + "</select></div><div class='col-xs-5 lowPad' style='text-align: right'>Up To: <input class='structConfigQuantity' id='structQuant" + item + "' type='number' value='" + ((setting && setting.buyMax) ? setting.buyMax : 0 ) + "'/></div></div></td>";
count++;
}
if (game.global.highestLevelCleared >= 229){
var nurserySetting = (typeof game.global.autoStructureSetting.NurseryZones !== 'undefined') ? game.global.autoStructureSetting.NurseryZones : 1;
tooltipText += "</tr><tr><td> </td><td><div class='row'><div class='col-xs-12' style='text-align: right; padding-right: 5px;'>Don't buy Nurseries Until Z: <input style='width: 20.8%; margin-right: 4%;' class='structConfigQuantity' id='structZoneNursery' type='number' value='" + nurserySetting + "'></div></div></td>";
}
tooltipText += "</tr></tbody></table>";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='saveAutoStructureConfig()'>Apply</div><div class='btn btn-danger' onclick='cancelTooltip()'>Cancel</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
ondisplay = function(){
verticalCenterTooltip(true);
};
}
if (what == "AutoStructure"){
tooltipText = "<p>Your mastery of this world has enabled your Foremen to handle fairly complicated orders regarding which buildings should be built. Click the cog icon on the right side of this button to tell your Foremen what you want and when you want it, then click the left side of the button to tell them to start or stop.</p>";
costText = "";
}
if (what == "Configure Generator State"){
geneMenuOpen = true;
elem = document.getElementById('tooltipDiv2');
tip2 = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
tooltipText = "<div style='padding: 1.5vw;'><div style='color: red; font-size: 1.1em; text-align: center;' id='genStateConfigError'></div>"
tooltipText += "<div id='genStateConfigTooltip'>" + getGenStateConfigTooltip() + "</div>";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='saveGenStateConfig()'>Apply</div><div class='btn btn-danger' onclick='cancelTooltip()'>Cancel</div></div>";
}
if (what == "Configure AutoJobs"){
tooltipText = "<div style='color: red; font-size: 1.1em; text-align: center;' id='autoJobsError'></div><p>Welcome to AutoJobs! <span id='autoJobsHelpBtn' style='font-size: 0.6vw;' class='btn btn-md btn-info' onclick='toggleAutoJobsHelp()'>Help</span></p><div id='autoJobsHelpDiv' style='display: none'><p>The left side of this window is dedicated to jobs that are limited more by workspaces than resources. 1:1:1:1 will purchase all 4 of these ratio-based jobs evenly, and the ratio refers to the amount of workspaces you wish to dedicate to each job. You can use any number larger than 0. Ratio-based jobs will be purchased once at the end of every Zone AND once every 30 seconds, but not more often than once every 2 seconds.</p><p>The right side of this window is dedicated to jobs limited more by resources than workspaces. Set the dropdown to the percentage of resources that you'd like to be spent on each job, and add a max amount if you wish (0 for unlimited). Percentage-based jobs are purchased once every 2 seconds.</p></div><table id='autoStructureConfigTable' style='font-size: 1.1vw;'><tbody>";
var percentJobs = ["Trainer", "Explorer", "Magmamancer"];
var ratioJobs = ["Farmer", "Lumberjack", "Miner", "Scientist"];
var count = 0;
for (var x = 0; x < ratioJobs.length; x++){
tooltipText += "<tr>";
var item = ratioJobs[x];
var setting = game.global.autoJobsSetting[item];
var selectedPerc = (setting) ? setting.value : 0.1;
var max;
var checkbox = buildNiceCheckbox('autoJobCheckbox' + item, 'autoCheckbox', (setting && setting.enabled));
tooltipText += "<td style='width: 40%'><div class='row'><div class='col-xs-6' style='padding-right: 5px'>" + checkbox + " <span>" + item + "</span></div><div class='col-xs-6 lowPad' style='text-align: right'>Ratio: <input class='jobConfigQuantity' id='autoJobQuant" + item + "' type='number' value='" + ((setting && setting.ratio) ? setting.ratio : 1 ) + "'/></div></div></td>"
if (ratioJobs[x] == "Scientist"){
max = ((setting && setting.buyMax) ? setting.buyMax : 0 );
if (max > 1e4) max = max.toExponential().replace('+', '');
tooltipText += "<td style='width: 60%'><div class='row' style='width: 50%; border: 0; text-align: left;'><span style='padding-left: 0.4vw'> </span>Up To: <input class='jobConfigQuantity' id='autoJobQuant" + item + "' value='" + prettify(max) + "'/></div></td>"
}
if (percentJobs.length > x){
item = percentJobs[x];
setting = game.global.autoJobsSetting[item];
selectedPerc = (setting) ? setting.value : 0.1;
max = ((setting && setting.buyMax) ? setting.buyMax : 0 );
if (max > 1e4) max = max.toExponential().replace('+', '');
checkbox = buildNiceCheckbox('autoJobCheckbox' + item, 'autoCheckbox', (setting && setting.enabled));
var options = "<option value='0.1'" + ((selectedPerc == 0.001) ? " selected" : "") + ">0.1%</option><option value='1'" + ((selectedPerc == .01) ? " selected" : "") + ">1%</option><option value='5'" + ((selectedPerc == .05) ? " selected" : "") + ">5%</option><option value='10'" + ((selectedPerc == .10) ? " selected" : "") + ">10%</option><option value='25'" + ((selectedPerc == .25) ? " selected" : "") + ">25%</option>";
tooltipText += "<td style='width: 60%'><div class='row'><div class='col-xs-5' style='padding-right: 5px'>" + checkbox + " <span>" + item + "</span></div><div style='text-align: center; padding-left: 0px;' class='col-xs-2'><select id='autoJobSelect" + item + "'>" + options + "</select></div><div class='col-xs-5 lowPad' style='text-align: right'>Up To: <input class='jobConfigQuantity' id='autoJobQuant" + item + "' value='" + prettify(max) + "'/></div></div></td></tr>";
}
}
//tooltipText += "<tr><td style='width: 40%'><div class='col-xs-6' style='padding-right: 5px'><input class='jobConfigCheckbox' type='checkbox' style='visibility: hidden' />Unemployed</div><div class='col-xs-6 lowPad' style='text-align: left; padding-left: 1.05vw;'>Ratio: <span id='autoJobsUnemployedRatio'>0</span></div></td><td style='width: 60%'> </td></tr>";
tooltipText += "</tbody></table>";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='saveAutoJobsConfig()'>Apply</div><div class='btn btn-danger' onclick='cancelTooltip()'>Cancel</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
ondisplay = function(){
verticalCenterTooltip(true);
};
}
if (what == "AutoJobs"){
tooltipText = "<p>Your continued mastery of this world has enabled you to set rules for automatic job allocation. Click the cog icon on the right side of this button to tell your Human Resourceimps what you want and when you want it, then click the left side of the button to tell them to start or stop.</p>";
costText = "";
}
if (what == "AutoGolden"){
tooltipText = '<p>Thanks to your brilliant Scientists, you can designate Golden Upgrades to be purchased automatically! Toggle between: </p><p><b>AutoGolden Off</b> when you\'re not feeling particularly trusting.</p><p><b>AutoGolden Helium (' + game.goldenUpgrades.Helium.purchasedAt.length + '/' + Math.round(game.goldenUpgrades.Helium.currentBonus * 100) + '%)</b> when you\'re looking to boost your Perk game. 4/5 Trimps agree that this will increase your overall Helium earned, though none of the 5 really understood the question.</p><p><b>AutoGolden Battle (' + game.goldenUpgrades.Battle.purchasedAt.length + '/' + Math.round(game.goldenUpgrades.Battle.currentBonus * 100) + '%)</b> if your Trimps have a tendency to slack off when you turn your back.</p><p><b>AutoGolden Void (' + game.goldenUpgrades.Void.purchasedAt.length + '/' + Math.round(game.goldenUpgrades.Void.currentBonus * 100) + '%)</b> if you need some more purple in your life. This is your Trimps\' least favorite choice, but it\'s pretty lucrative so...</p><p>Please allow 4 seconds for Trimp retraining after clicking this button before any Golden Upgrades are automatically purchased, and don\'t forget to frequently thank your scientists! Seriously, they get moody.</p>';
costText = "";
}
if (what == "Unliving"){
var stacks = game.challenges.Life.stacks;
var mult = game.challenges.Life.getHealthMult(true);
if (stacks > 130) tooltipText = "Your Trimps are looking quite dead, which is very healthy in this dimension. You're doing a great job!";
else if (stacks > 75) tooltipText = "Your Trimps are starting to look more lively and slow down, but at least they're still fairly pale.";
else if (stacks > 30) tooltipText = "The bad guys in this dimension seem to be way more dead than your Trimps!";
else tooltipText = "Your Trimps look perfectly normal and healthy now, which is not what you want in this dimension.";
tooltipText += " <b>Trimp attack and health increased by " + mult + ".</b>";
costText = "";
}
if (what == "AutoGolden Unlocked"){
tooltipText = "<p>Your Trimps have extracted and processed hundreds of Golden Upgrades by now, and though you're still nervous to leave things completely to them, you figure they can probably handle doing this on their own as well. You find the nearest Trimp and ask if he could handle buying Golden Upgrades on his own, as long as you told him which ones to buy. You can tell by the puddle of drool rapidly gaining mass at his feet that this is going to take either magic or a lot of hard work.</p><p>You can't find any magic anywhere, so you decide to found Trimp University, a school dedicated to teaching Trimps how to extract the might of Golden Upgrades without any assistance. Weeks go by while you and your Trimps work tirelessly to set up the University, choosing only the finest building materials and hiring only the most renowned Foremen to draw the plans. Just as you're finishing up, a Scientist stops by, sees what you're doing, and offers to just handle the Golden Upgrades instead. Probably should have just asked one of them first.</p><p><b>You have unlocked AutoGolden!</b></p>";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='cancelTooltip()'>Close</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Poisoned"){
tooltipText = "This enemy is harmed by the Empowerment of Poison, and is taking " + prettify(game.empowerments.Poison.currentDebuffPower) + " extra damage per turn.";
costText = "";
}
if (what == "Chilled"){
tooltipText = "This enemy has been chilled by the Empowerment of Ice, is taking " + prettify((1 - game.empowerments.Ice.getCombatModifier()) * 100) + "% more damage, and is dealing " + prettify((1 - game.empowerments.Ice.getCombatModifier()) * 100) + "% less damage with each normal attack.";
costText = "";
}
if (what == "Breezy"){
var heliumText = (!game.global.mapsActive)? "increasing all Helium gained by " + prettify(game.empowerments.Wind.getCombatModifier() * 100) + "% and all other" : "increasing all non-Helium ";
tooltipText = "There is a rather large amount of Wind swelling around this enemy, " + heliumText + " resources by " + prettify(game.empowerments.Wind.getCombatModifier() * 1000) + "%.";
costText = "";
}
if (what == "Perk Preset"){
if (textString == "Save"){
what = "Save Perk Preset";
tooltipText = "Click to save your current perk loadout to the selected preset";
}
else if (textString == "Rename"){
what = "Rename Perk Preset";
tooltipText = "Click to set a name for your currently selected perk preset";
}
else if (textString == "Load"){
what = "Load Perk Preset";
tooltipText = "Click to load your currently selected perk preset.";
if (!game.global.respecActive) tooltipText += " <p class='red'>You must have your Respec active to load a preset!</p>";
}
else if (textString == "Import"){
what = "Import Perk Preset";
tooltipText = "Click to import a perk setup from a text string";
}
else if (textString == "Export"){
what = "Export Perk Setup";
tooltipText = "Click to export a copy of your current perk setup to share with friends, or to save and import later!"
}
else if (textString > 0 && textString <= 3){
var preset = game.global["perkPreset" + textString];
if (typeof preset === 'undefined') return;
what = (preset.Name) ? "Preset: " + preset.Name : "Preset " + textString;
if (isObjectEmpty(preset)){
tooltipText = "<span class='red'>This Preset slot is empty!</span> Select this slot and then click 'Save' to save your current Perk configuration to this slot. You'll be able to load this configuration back whenever you want, as long as you have your Respec active.";
}
else{
tooltipText = "<p style='font-weight: bold'>This Preset holds:</p>";
var count = 0;
for (var item in preset){
if (item == "Name") continue;
tooltipText += (count > 0) ? ", " : "";
tooltipText += '<b>' + item.replace('_', ' ') + ":</b> " + preset[item];
count++;
}
}
}
}
if (what == "Rename Preset"){
what == "Rename Preset " + selectedPreset;
tooltipText = "Type a name below for your Perk Preset! This name will show up on the Preset bar and make it easy to identify which Preset is which."
if (textString) tooltipText += " <b>Max of 1,000 for most perks</b>";
var preset = game.global["perkPreset" + selectedPreset];
var oldName = (preset && preset.Name) ? preset.Name : "";
tooltipText += "<br/><br/><input id='renamePresetBox' maxlength='25' style='width: 50%' value='" + oldName + "' />";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='renamePerkPreset()'>Apply</div><div class='btn btn-info' onclick='cancelTooltip()'>Cancel</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
ondisplay = function() {
var box = document.getElementById("renamePresetBox");
// Chrome chokes on setSelectionRange on a number box; fall back to select()
try { box.setSelectionRange(0, box.value.length); }
catch (e) { box.select(); }
box.focus();
};
noExtraCheck = true;
}
if (what == "UnlockedChallenge2"){
what = "Unlocked Challenge<sup>2</sup>";
tooltipText = "You hear some strange noises behind you and turn around to see three excited scientists. They inform you that they've figured out a way to modify The Portal to take you to a new type of challenging dimension, a system they proudly call 'Challenge<sup>2</sup>'. You will be able to activate and check out their new technology by clicking the 'Challenge<sup>2</sup>' button next time you go to use The Portal.";
game.global.lockTooltip = true;
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>Thanks, Scientists</div></div>";
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Eggs"){
tooltipText = '<span class="eggMessage">It seems as if some sort of animal has placed a bunch of brightly colored eggs in the world. If you happen to see one, you can click on it to send a Trimp to pick it up! According to your scientists, they have a rare chance to contain some neat stuff, but they will not last forever...</span>';
game.global.lockTooltip = true;
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>I'll keep an eye out.</div></div>";
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Portal"){
tooltipText = "The portal device you found shines green in the lab. Such a familiar shade...";
costText = "";
}
if (what == "Repeat Map"){
tooltipText = "Allow the Trimps to find their way back to square 1 once they finish without your help. They grow up so fast. <br/><br/>If you are <b>not</b> repeating, your current group of Trimps will not be abandoned after the map ends. (Hotkey: R)";
costText = "";
}
if (what == "Challenge2"){
what = "Challenge<sup>2</sup>";
tooltipText = "";
if (!textString)
tooltipText = "<p>Click to toggle a challenge mode for your challenges!</p>";
tooltipText += "<p>In Challenge<sup>2</sup> mode, you can re-run some challenges in order to earn a permanent attack, health, and Helium bonus for your Trimps. MOST Challenge<sup>2</sup>s will grant <b>" + squaredConfig.rewardEach + "% attack and health and " + prettify(squaredConfig.rewardEach / 10) + "% increased Helium for every " + squaredConfig.rewardFreq + " Zones reached. Every " + squaredConfig.thresh + " Zones, the attack and health bonus will increase by an additional 1%, and the Helium bonus will increase by 0.1%</b>. This bonus is additive with all available Challenge<sup>2</sup>s, and your highest Zone reached for each challenge is saved and used.</p><p><b>No Challenge<sup>2</sup>s end at any specific Zone</b>, they can only be completed by using your portal or abandoning through the 'View Perks' menu. However, <b>no Helium can drop, and no bonus Helium will be earned during or after the run</b>. Void Maps will still drop heirlooms, and all other currency can still be earned.</p><p>You are currently gaining " + prettify(game.global.totalSquaredReward) + "% extra attack and health, and are gaining " + prettify(game.global.totalSquaredReward / 10) + "% extra Helium thanks to your Challenge<sup>2</sup> bonus.</p>";
if (game.talents.headstart.purchased) tooltipText += "<p><b>Note that your Headstart mastery will be disabled during Challenge<sup>2</sup> runs.</b></p>";
costText = "";
}
if (what == "Geneticistassist Settings"){
if (isItIn == null){
geneMenuOpen = true;
elem = document.getElementById('tooltipDiv2');
tip2 = true;
var steps = game.global.GeneticistassistSteps;
tooltipText = "<div id='GATargetError'></div><div>Customize the target thresholds for your Geneticistassist! Use a number between 0.5 and 60 seconds for all 3 boxes. Each box corresponds to a Geneticistassist toggle threshold.</div><div style='width: 100%'><input class='GACustomInput' id='target1' value='" + steps[1] + "'/><input class='GACustomInput' id='target2' value='" + steps[2] + "'/><input class='GACustomInput' id='target3' value='" + steps[3] + "'/><hr class='noBotMarg'/><div class='maxCenter'>" + getSettingHtml(game.options.menu.gaFire, 'gaFire') + getSettingHtml(game.options.menu.geneSend, 'geneSend') + "</div><hr class='noTopMarg'/><div id='GADisableCheck'>" + buildNiceCheckbox('disableOnUnlockCheck', null, game.options.menu.GeneticistassistTarget.disableOnUnlock) + " Start disabled when unlocked each run</div></div>";
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='customizeGATargets();'>Confirm</div> <div class='btn btn-danger' onclick='cancelTooltip()'>Cancel</div>"
elem.style.left = "33.75%";
elem.style.top = "25%";
}
}
if (what == "Configure Maps"){
if (isItIn == null){
geneMenuOpen = true;
elem = document.getElementById('tooltipDiv2');
tip2 = true;
var steps = game.global.GeneticistassistSteps;
tooltipText = "<div id='GATargetError'></div><div>Customize your settings for running maps!</div>";
tooltipText += "<hr class='noBotMarg'/><div class='maxCenter'>"
var settingCount = 0;
if (game.global.totalPortals >= 1) {
tooltipText += getSettingHtml(game.options.menu.mapLoot, 'mapLoot', null, "CM");
settingCount++;
}
if (game.global.totalPortals >= 5){
tooltipText += getSettingHtml(game.options.menu.repeatVoids, 'repeatVoids', null, "CM");
settingCount++;
}
if (settingCount % 2 == 0) tooltipText += "<br/><br/>";
tooltipText += '<div class="optionContainer"><div class="noselect settingsBtn ' + ((game.global.repeatMap) ? "settingBtn1" : "settingBtn0") + '" id="repeatBtn2" onmouseover="tooltip(\'Repeat Map\', null, event)" onmouseout="tooltip(\'hide\')" onclick="repeatClicked()">' + ((game.global.repeatMap) ? "Repeat On" : "Repeat Off") + '</div></div>';
settingCount++;
if (settingCount % 2 == 0) tooltipText += "<br/><br/>";
tooltipText += getSettingHtml(game.options.menu.repeatUntil, 'repeatUntil', null, "CM");
settingCount++;
if (settingCount % 2 == 0) tooltipText += "<br/><br/>";
tooltipText += getSettingHtml(game.options.menu.exitTo, 'exitTo', null, "CM")
settingCount++;
if (game.options.menu.mapsOnSpire.lockUnless()){
if (settingCount % 2 == 0) tooltipText += "<br/><br/>";
tooltipText += getSettingHtml(game.options.menu.mapsOnSpire, 'mapsOnSpire', null, "CM");
settingCount++;
}
if (game.global.canMapAtZone){
if (settingCount % 2 == 0) tooltipText += "<br/><br/>";
tooltipText += getSettingHtml(game.options.menu.mapAtZone, 'mapAtZone', null, "CM");
settingCount++;
}
tooltipText += "</div>";
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip();'>Close</div></div>"
elem.style.left = "33.75%";
elem.style.top = "25%";
}
}
if (what == "Set Map At Zone"){
tooltipText = "Enter up to 5 numbers between 10 and 1000, separated by commas. Next time you reach any of those Zone numbers, you will automatically be pulled into the Map Chamber.<div id='mapAtZoneErrorText'></div><br/><input style='width: 50%; margin-left: 25%' id='mapAtZoneInput' value='" + game.options.menu.mapAtZone.setZone + "'/>";
costText = "<div class='maxCenter'><span class='btn btn-success btn-md' id='confirmTooltipBtn' onclick='saveMapAtZone()'>Confirm</span><span class='btn btn-danger btn-md' onclick='cancelTooltip(true)'>Cancel</span>"
game.global.lockTooltip = true;
elem.style.top = "25%";
elem.style.left = "25%";
ondisplay = function(){
document.getElementById('mapAtZoneInput').select();
}
}
if (what == "Message Config"){
tooltipText = "<div id='messageConfigMessage'>Here you can finely tune your message settings, to see only what you want from each category. Mouse over the name of a filter for more info.</div>";
var msgs = game.global.messages;
var toCheck = ["Loot", "Unlocks", "Combat"];
tooltipText += "<div class='row'>";
for (var x = 0; x < toCheck.length; x++){
var name = toCheck[x];
tooltipText += "<div class='col-xs-4'><span class='messageConfigTitle'>" + toCheck[x] + "</span><br/>";
for (var item in msgs[name]){
if (item == "essence" && game.global.highestLevelCleared < 179) continue;
if (item == "magma" && game.global.highestLevelCleared < 229) continue;
if (item == "cache" && game.global.highestLevelCleared < 59) continue;
if (item == "token" && game.global.highestLevelCleared < 235) continue;
if (item == 'enabled') continue;
tooltipText += "<span class='messageConfigContainer'><span class='messageCheckboxHolder'>" + buildNiceCheckbox(name + item, 'messageConfigCheckbox', (msgs[name][item])) + "</span><span onmouseover='messageConfigHover(\"" + name + item + "\", event)' onmouseout='tooltip(\"hide\")' class='messageNameHolder'> - " + item.charAt(0).toUpperCase() + item.substr(1) + "</span></span><br/>";
}
tooltipText += "</div>";
}
tooltipText += "</div>";
ondisplay = function () {verticalCenterTooltip();};
game.global.lockTooltip = true;
elem.style.top = "25%";
elem.style.left = "25%";
swapClass('tooltipExtra', 'tooltipExtraLg', elem);
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip();configMessages();'>Confirm</div> <div class='btn btn-danger' onclick='cancelTooltip()'>Cancel</div>"
}
if (isItIn == "goldenUpgrades"){
var upgrade = game.goldenUpgrades[what];
var timesPurchased = upgrade.purchasedAt.length
var s = (timesPurchased == 1) ? "" : "s";
var three = (game.global.totalPortals >= 5) ? "three" : "two";
tooltipText += " <b>You can only choose one of these " + three + " Golden Upgrades. Choose wisely...</b><br/><br/> Each time Golden Upgrades are unlocked, they will increase in strength. You are currently gaining " + Math.round(upgrade.currentBonus * 100) + "% from purchasing this upgrade " + timesPurchased + " time" + s + " since your last portal.";
if (what == "Void" && (parseFloat((game.goldenUpgrades.Void.currentBonus + game.goldenUpgrades.Void.nextAmt()).toFixed(2)) > 0.60)) tooltipText += "<br/><br/><b class='red'>This upgrade would put you over 60% increased Void Map chance, which would destabilize the universe. You don't want to destabilize the universe, do you?</b>";
if (what == "Helium" && game.global.runningChallengeSquared) tooltipText += "<br/><br/><b class='red'>You can't earn helium while running a Challenge<sup>2</sup>!</b>";
costText = "Free";
if (getAvailableGoldenUpgrades() > 1) costText += " (" + getAvailableGoldenUpgrades() + " remaining)";
what = "Golden " + what + " (Tier " + romanNumeral(game.global.goldenUpgrades + 1) + ")";
}
if (isItIn == "talents"){
var talent = game.talents[what];
tooltipText = talent.description;
var nextTalCost = getNextTalentCost();
var thisTierTalents = countPurchasedTalents(talent.tier);
if (ctrlPressed){
var highestAffordable = getHighestPurchaseableRow();
var highestIdeal = getHighestIdealRow();
var isAffordable = (highestAffordable >= talent.tier);
var isIdeal = (highestIdeal >= talent.tier);
if (thisTierTalents == 6) {
costText = "<span class='green'>You have already purchased this tier!</span>";
}
else if (isIdeal) {
costText = "<span class='green'>You must buy this entire tier to be able to spend all of your Dark Essence.</span>"
}
else if (isAffordable) {
costText = "<span class='green'>You can afford to purchase this entire tier!</span> <span class='red'>However, purchasing this entire tier right now may limit which other Masteries you can reach.</span>"
}
else {
costText = "<span class='red'>You cannot afford to purchase this entire tier.</span>"
}
}
else{
if (talent.purchased)
costText = "<span style='color: green'>Purchased</span>";
else if (getAllowedTalentTiers()[talent.tier - 1] < 1 && thisTierTalents < 6){
costText = "<span style='color: red'>Locked";
var lastTierTalents = countPurchasedTalents(talent.tier - 1);
if (lastTierTalents <= 1) costText += " (Buy " + ((lastTierTalents == 0) ? "2 Masteries" : "1 more Mastery") + " from Tier " + (talent.tier - 1) + " to unlock Tier " + talent.tier;
else costText += " (Buy 1 more Mastery from Tier " + (talent.tier - 1) + " to unlock the next from Tier " + talent.tier;
if (typeof talent.requires !== 'undefined' && !game.talents[talent.requires].purchased) {
costText += ". This Mastery also requires " + game.talents[talent.requires].name;
}
costText += ")</span>"
}
else if (typeof talent.requires !== 'undefined' && !game.talents[talent.requires].purchased)
costText = "<span style='color: red'>Requires " + game.talents[talent.requires].name + "</span>";
else if (game.global.essence < nextTalCost && prettify(game.global.essence) != prettify(nextTalCost))
costText = "<span style='color: red'>" + prettify(nextTalCost) + " Dark Essence (Use Scrying Formation to earn more)</span>";
else {
costText = prettify(nextTalCost) + " Dark Essence";
if (canPurchaseRow(talent.tier)) {
costText += "<br/><b style='color: black; font-size: 0.8vw;'>You can afford to purchase this whole row! Hold Ctrl when clicking to buy this entire row and any uncompleted rows before it.</b>";
}
}
}
what = talent.name;
noExtraCheck = true;
}
if (what == "Mastery"){
tooltipText = "<p>Click to view your masteries.</p><p>You currently have " + prettify(game.global.essence) + "</b> Dark Essence.</p>"
}
if (what == "The Improbability"){
tooltipText = "<span class='planetBreakMessage'>That shouldn't have happened. There should have been a Blimp there. Something is growing unstable.</span>";
if (!game.global.autoUpgradesAvailable) tooltipText += "<br/><br/><span class='planetBreakMessage'><b>Your Trimps seem to understand that they'll need to help out more, and you realize how to permanently use them to automate upgrades!<b></span><br/>";
costText = "<span class='planetBreakDescription'><span class='bad'>Trimp breed speed reduced by a factor of 10. 20% of enemy damage can now penetrate your block.</span><span class='good'> You have unlocked a new upgrade to learn a Formation. Helium harvested per Zone is increased by a factor of 5. Equipment cost is dramatically cheaper. Creating modified maps is now cheaper, and your scientists have found new ways to improve maps! You have access to the 'Trimp' challenge!<span></span>";
if (game.global.challengeActive == "Corrupted") costText += "<br/><br/><span class='corruptedBadGuyName'>Looks like the Corruption is starting early...</span>";
costText += "<hr/><div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>I'll be fine</div><div class='btn btn-danger' onclick='cancelTooltip(); message(\"Sorry\", \"Notices\")'>I'm Scared</div></div>"
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Corruption"){
if (game.global.challengeActive == "Corrupted"){
tooltipText = "<span class='planetBreakMessage'>Though you've seen the Corruption grow since the planet broke, you can now see a giant spire pumping out tons of the purple goo. Things seem to be absorbing it at a higher rate now.</span><br/>";
costText += "<span class='planetBreakDescription'><span class='bad'>Improbabilities and Void Maps are now more difficult.</span> <span class='good'>Improbabilities and Void Maps now drop 2x helium.</span></span>";
}
else {
tooltipText = (game.talents.headstart.purchased) ? "Off in the distance, you can see a giant spire grow larger as you approach it." : "You can now see a giant spire only about 20 Zones ahead of you.";
tooltipText = "<span class='planetBreakMessage'>" + tooltipText + " Menacing plumes of some sort of goopy gas boil out of the spire and appear to be tainting the land even further. It looks to you like the Zones are permanently damaged, poor planet. You know that if you want to reach the spire, you'll have to deal with the goo.</span><br/>";
costText = "<span class='planetBreakDescription'><span class='bad'>From now on as you press further through Zones, more and more corrupted cells of higher and higher difficulty will begin to spawn. Improbabilities and Void Maps are now more difficult.</span> <span class='good'>Improbabilities and Void Maps now drop 2x helium. Each corrupted cell will drop 15% of that Zone's helium reward.</span></span> ";
}
costText += "<hr/><div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>Bring it on</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "The Spire"){
tooltipText = "<span class='planetBreakMessage'>The Spire looms menacingly above you, and you take in a deep breath of corruption. You take a look back at your Trimps to help gather some courage, and you push the door open. You slowly walk inside and are greeted by an incredibly loud, deep, human voice.<br/><br/><b>Do you know what you face? If you are defeated ten times in this place, you shall be removed from this space. If you succeed, then you shall see the light of knowledge that you seek.</b><span>";
tooltipText += "<br/><hr/><span class='planetBreakDescription'><span class='bad'>This Zone is considerably more difficult than the previous and next Zones. If 10 groups of Trimps die in combat while in the spire, the world will return to normal.</span> <span class='good'>Each cell gives more and more helium. Every 10th cell gives a larger reward, and increases all loot gained until your next portal by 2% (including helium).</span>";
if (game.options.menu.mapsOnSpire.enabled) tooltipText += "<br/><hr/>You were moved to Maps to protect your limited chances at the spire. You can disable this in settings!";
costText = "<div class='maxCenter'><div class='btn btn-info' onclick='startSpire(true)'>Bring it on</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "The Magma"){
tooltipText = "<p>You stumble across a large locked chest, unlike anything you've ever seen. The lock looks rusty, you smack it with a rock, and it falls right off. Immediately the ground shakes and cracks beneath your feet, intense heat hits your face, and Magma boils up from the core.</p><p>Where one minute ago there was dirt, grass, and noxious fog, there are now rivers of molten rock (and noxious fog). You'd really like to try and repair the planet somehow, so you decide to keep pushing on. It's been working out well so far, there was some useful stuff in that chest!</p><hr/>";
tooltipText += "<span class='planetBreakDescription'><span class='bad'>The heat is tough on your Trimps, causing each Zone to reduce their attack and health by 20% more than the last. 10% of your Nurseries will permanently close after each Zone to avoid Magma flows, and Corruption has seeped into both Void and regular Maps, further increasing their difficulty. </span><span class='good'> However, the chest contained plans and materials for the <b>Dimensional Generator</b> building, <b>" + prettify(textString) + " Helium</b>, and <b>100 copies of Coordination</b>! In addition, all Zones are now worth <b>3x Helium</b>!<span></span>";
costText += "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>K</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Exit Spire"){
tooltipText = "This will exit the spire, and you will be unable to re-enter until your next portal. Are you sure?";
costText = "<div class='maxCenter'><div class='btn btn-info' onclick='cancelTooltip(); endSpire()'>Exit Spire</div><div class='btn btn-danger' onclick='cancelTooltip()'>Cancel</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Confirm Respec Masteries"){
if (!textString)
tooltipText = "This will return all Dark Essence that was spent on Masteries at the cost of 20 bones. Are you sure?";
else
tooltipText = "This will return all Dark Essence that was spent on Masteries, and will use " + ((game.global.freeTalentRespecs > 1) ? "one of " : "") + "your remaining " + game.global.freeTalentRespecs + " free Mastery Respec" + needAnS(game.global.freeTalentRespecs) + ".";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='cancelTooltip(); respecTalents(true)'>Respec</div><div class='btn btn-danger' onclick='cancelTooltip()'>Cancel</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Respec Masteries"){
tooltipText = "<p>Click to Respec, refunding all Dark Essence that was spent on Masteries.<p>";
if (game.global.freeTalentRespecs > 0) tooltipText += "<p>Your first 3 Respecs are free, and you still have " + game.global.freeTalentRespecs + " left! When there are no more left, each respec will cost 20 Bones."
costText = (game.global.freeTalentRespecs > 0) ? "Free!" : ((game.global.b >= 20) ? "<span class='green'>" : "<span class='red'>") + "20 Bones</span>";
}
if (what == "The Geneticistassist"){
tooltipText = "Greetings, friend! I'm your new robotic pal <b>The Geneticistassist</b> and I am here to assist you with your Geneticists. I will hang out in your Jobs tab, and will appear every run after Geneticists are unlocked. You can customize me in Settings under 'General'!";
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>Thanks, Geneticistassist!</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "MagnetoShriek"){
var shriekValue = ((1 - game.mapUnlocks.roboTrimp.getShriekValue()) * 100).toFixed(1);
tooltipText = "Your pet RoboTrimp seems to be gifted at distorting the magnetic field around certain bad guys, especially Improbabilities. You can activate this ability once every 5 Zones in order to tell your RoboTrimp to reduce the attack damage of the next Improbability by " + shriekValue + "%. This must be reactivated each time it comes off cooldown.";
tooltipText += "<span id='roboTrimpTooltipActive' style='font-weight: bold'><br/><br/>";
tooltipText += (game.global.useShriek) ? "MagnetoShriek is currently active and will fire on the next Improbability." : "MagnetoShriek is NOT active and will not fire.";
tooltipText += "</span>";
costText = "";
//elem.style.top = "55%";
}
if (what == "Reset"){
tooltipText = "Are you sure you want to reset? This will really actually reset your game. You won't get anything cool. It will be gone. <b style='color: red'>This is not the soft-reset you're looking for. This will delete your save.</b>";
costText="<div class='maxCenter'><div class='btn btn-danger' onclick='resetGame();unlockTooltip();tooltip(\"hide\")'>Delete Save</div> <div class='btn btn-info' onclick='cancelTooltip()'>Cancel</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Fight"){
tooltipText = "Send your poor Trimps to certain doom in the battlefield. You'll get cool stuff though, they'll understand. (Hotkey: F)";
var currentSend = game.resources.trimps.getCurrentSend();
costText = (currentSend > 1) ? "s" : "";
costText = prettify(currentSend) + " Trimp" + costText;
}
if (what == "AutoFight"){
tooltipText = "Allow the Trimps to start fighting on their own whenever their town gets overcrowded (Hotkey: A)";
costText = "";
}
if (what == "New Achievements"){
tooltipText = "The universe has taken an interest in your achievements, and has begun tracking them. You already have some completed thanks to your previous adventures, would you like to see them?";
costText = "<div class='maxCenter'><div class='btn btn-success' onclick='toggleAchievementWindow(); cancelTooltip()'>Check Achievements</div> <div class='btn btn-danger' onclick='cancelTooltip()'>No, That Sounds Dumb</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Upgrade Generator"){
tooltipText = getGeneratorUpgradeHtml();
costText = "<b style='color: red'>These upgrades persist through portal and cannot be refunded. Choose wisely! " + getMagmiteDecayAmt() + "% of your unspent Magmite will decay on portal.</b><br/><br/><div class='maxCenter'><span class='btn btn-info' onclick='cancelTooltip()'>Close</span></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
ondisplay = function(){
updateGeneratorUpgradeHtml();
verticalCenterTooltip();
};
titleText = "<div id='generatorUpgradeTitle'>Upgrade Generator</div><div id='magmiteOwned'></div>";
}
if (what == "Queue"){
tooltipText = "This is a building in your queue, you'll need to click \"Build\" to build it. Clicking an item in the queue will cancel it for a full refund.";
costText = "";
}
if (what == "Toxic" && isItIn != "dailyStack"){
tooltipText = "This bad guy is toxic. You will obtain " + (game.challenges.Toxicity.lootMult * game.challenges.Toxicity.stacks).toFixed(1) + "% more resources! Oh, also, this bad guy has 5x attack, 2x health, your Trimps will lose 5% health each time they attack, and the toxic air is causing your Trimps to breed " + (100 - (Math.pow(game.challenges.Toxicity.stackMult, game.challenges.Toxicity.stacks) * 100)).toFixed(2) + "% slower. These stacks will reset after clearing the Zone.";
costText = "";
}
if (what == "Momentum"){
var stacks = game.challenges.Lead.stacks;
tooltipText = "This bad guy has " + prettify(stacks * 4) + "% more damage and health, pierces an additional " + (stacks * 0.1).toFixed(1) + "% block, and each attack that does not kill it will cause your Trimps to lose " + (stacks * 0.03).toFixed(2) + "% of their health.";
costText = "";
}
if (what == "Custom"){
customUp = (textString) ? 2 : 1;
tooltipText = "Type a number below to purchase a specific amount. You can also use shorthand such as 2e5 and 200k to select that large number, or fractions such as 1/2 and 50% to select that fraction of your available workspaces."
if (textString) tooltipText += " <b>Max of 1,000 for most perks</b>";
tooltipText += "<br/><br/><input id='customNumberBox' style='width: 50%' value='" + ((!isNumberBad(game.global.lastCustomExact)) ? prettify(game.global.lastCustomExact) : game.global.lastCustomExact) + "' />";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='numTab(5, " + textString + ")'>Apply</div><div class='btn btn-info' onclick='cancelTooltip()'>Cancel</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
ondisplay = function() {
var box = document.getElementById("customNumberBox");
// Chrome chokes on setSelectionRange on a number box; fall back to select()
try { box.setSelectionRange(0, box.value.length); }
catch (e) { box.select(); }
box.focus();
};
noExtraCheck = true;
}
if (what == "Max"){
var forPortal = (textString) ? true : false;
tooltipText = "No reason to spend everything in one place! Here you can set the ratio of your resources to spend when using the 'Max' button. Setting this to 0.5 will spend no more than half of your resources per click, etc."
costText = "<ul id='buyMaxUl'><li onclick='setMax(1, " + forPortal + ")'>Max</li><li onclick='setMax(0.5, " + forPortal + ")'>0.5</li><li onclick='setMax(0.33, " + forPortal + ")'>0.33</li><li onclick='setMax(0.25, " + forPortal + ")'>0.25</li><li onclick='setMax(0.1, " + forPortal + ")'>0.1</li></ul>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Export"){
var saveText = save(true);
if (textString){
tooltipText = textString + "<br/><br/><textarea id='exportArea' spellcheck='false' style='width: 100%' rows='5'>" + saveText + "</textarea>";
what = "Thanks!";
}
else
tooltipText = "This is your save string. There are many like it but this one is yours. Save this save somewhere safe so you can save time next time. <br/><br/><textarea spellcheck='false' id='exportArea' style='width: 100%' rows='5'>" + saveText + "</textarea>";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='cancelTooltip()'>Got it</div>";
if (document.queryCommandSupported('copy')){
costText += "<div id='clipBoardBtn' class='btn btn-success'>Copy to Clipboard</div>";
}
costText += "<a id='downloadLink' target='_blank' download='Trimps Save P" + game.global.totalPortals + " Z" + game.global.world + ".txt', href=";
if (Blob !== null) {
var blob = new Blob([saveText], {type: 'text/plain'});
var uri = URL.createObjectURL(blob);
costText += uri;
} else {
costText += 'data:text/plain,' + encodeURIComponent(saveText);
}
costText += " ><div class='btn btn-danger' id='downloadBtn'>Download as File</div></a>";
costText += "</div>";
ondisplay = tooltips.handleCopyButton();
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Export Perks"){
tooltipText = "It may not look like much, but all of your perks are in here! You can share this string with friends, or save it to your computer to import later!<br/><br/><textarea spellcheck='false' id='exportArea' style='width: 100%' rows='5'>" + exportPerks() + "</textarea>";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='cancelTooltip()'>Got it</div>";
if (document.queryCommandSupported('copy')){
costText += "<div id='clipBoardBtn' class='btn btn-success'>Copy to Clipboard</div>";
}
costText += "</div>";
ondisplay = tooltips.handleCopyButton();
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Import"){
tooltipText = "Import your save string! It'll be fun, I promise.<br/><br/><textarea spellcheck='false' id='importBox' style='width: 100%' rows='5'></textarea>";
costText="<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='cancelTooltip(); load(true);'>Import</div>"
if (playFabId != -1) costText += "<div class='btn btn-primary' onclick='loadFromPlayFab()'>Import From PlayFab</div>";
costText += "<div class='btn btn-info' onclick='cancelTooltip()'>Cancel</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
ondisplay = function () {
document.getElementById('importBox').focus();
}
}
if (what == "Import Perks"){
tooltipText = "Import your perks from a text string!<br/><br/><textarea spellcheck='false' id='perkImportBox' style='width: 100%' rows='5'></textarea>";
costText = "<p class='red'></p>";
costText += "<div id='confirmTooltipBtn' class='btn btn-info' onclick='this.previousSibling.innerText = importPerks()'>Import</div>";
costText += "<div class='btn btn-info' onclick='cancelTooltip()'>Cancel</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
ondisplay = function () {
document.getElementById('perkImportBox').focus();
};
}
if (what == "AutoPrestige"){
tooltipText = '<p>Your scientists have come a long way since you first crashed here, and can now purchase prestige upgrades automatically for you with hardly any catastrophic mistakes. They understand the word "No" and the following three commands: </p><p><b>AutoPrestige All</b> will always purchase the cheapest prestige available first.</p><p><b>Weapons Only</b> as you may be able to guess, will only purchase Weapon prestiges.</p><p><b>Weapons First</b> will only purchase Weapon prestiges unless the cheapest Armor prestige is less than 5% of the cost of the cheapest Weapon.</p>';
}
if (what == "AutoUpgrade"){
tooltipText = "Your scientists can finally handle some upgrades on their own! Toggling this on will cause most upgrades to be purchased automatically. Does not include equipment prestiges or upgrades that would trigger a confirmation popup.";
}
if (what == "Recycle All"){
tooltipText = "Recycle all maps below the selected level.";
}
if (what == "PlayFab Login"){
var tipHtml = getPlayFabLoginHTML();
tooltipText = tipHtml[0];
costText = tipHtml[1];
game.global.lockTooltip = true;
elem.style.top = "15%";
elem.style.left = "25%";
swapClass('tooltipExtra', 'tooltipExtraLg', elem);
noExtraCheck = true;
}
if (what == "PlayFab Conflict"){
tooltipText = "It looks like your save stored at PlayFab is further along than the save on your computer.<br/><b>Your save on PlayFab has earned " + prettify(textString) + " total Helium, defeated Zone " + attachFunction + ", and cleared " + prettify(numCheck) + " total Zones. The save on your computer only has " + prettify(game.global.totalHeliumEarned) + " total Helium, has defeated Zone " + game.global.highestLevelCleared + ", and cleared " + prettify(game.stats.zonesCleared.value + game.stats.zonesCleared.valueTotal) + " total Zones.</b><br/>Would you like to Download your save from PlayFab, Overwrite your online save with this one, or Cancel and do nothing?";
costText = "<span class='btn btn-primary' onclick='playFabFinishLogin(true)'>Download From PlayFab</span><span class='btn btn-warning' onclick='playFabFinishLogin(false)'>Overwrite PlayFab Save</span><span class='btn btn-danger' onclick='cancelPlayFab();'>Cancel</span>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Fire Trimps"){
if (!game.global.firing)
tooltipText = "Activate firing mode, turning the job buttons red, and forcing them to fire trimps rather than hire them. The newly unemployed Trimps will start breeding instead of working, but you will not receive a refund on resources.";
else
tooltipText = "Disable firing mode";
costText = "";
}
if (what == "Maps"){
if (!game.global.preMapsActive)
tooltipText = "Travel to the Map Chamber. Maps are filled with goodies, and for each max level map you clear you will gain a 20% stacking damage bonus for that Zone (stacks up to 10 times). (Hotkey: M)";
else
tooltipText = "Go back to the World Map. (Hotkey: M)";
costText = "";
}
if (what == 'Error') {
game.global.lockTooltip = true;
var returnObj = tooltips.showError(textString);
tooltipText = returnObj.tooltip;
costText = returnObj.costText;
ondisplay = tooltips.handleCopyButton();
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (isItIn == "jobs"){
var buyAmt = game.global.buyAmt;
if (buyAmt == "Max") buyAmt = calculateMaxAfford(game.jobs[what], false, false, true);
if (game.global.firing && what != "Amalgamator"){
var firstChar = what.charAt(0);
var aAn = (firstChar == "A" || firstChar == "E" || firstChar == "I" || firstChar == "O" || firstChar == "U") ? " an " : " a ";
tooltipText = "Fire " + aAn + " " + what + ". Refunds no resources, but frees up some workspace for your Trimps.";
costText = "";
}
else{
var workspaces = game.workspaces;
var ignoreWorkspaces = (game.jobs[what].allowAutoFire && game.options.menu.fireForJobs.enabled);
if (workspaces < buyAmt && !ignoreWorkspaces) buyAmt = workspaces;
costText = getTooltipJobText(what, buyAmt);
}
if (what == "Amalgamator") {
noExtraCheck = true;
costText = "";
}
else if (buyAmt > 1) what += " X " + prettify(buyAmt);
}
if (isItIn == "buildings"){
costText = canAffordBuilding(what, false, true);
if (game.global.buyAmt != 1) {
if (game.buildings[what].percent){
tooltipText += " <b>You can only purchase 1 " + what + " at a time.</b>";
what += " X 1";
}
else {
what += " X " + prettify((game.global.buyAmt == "Max") ? calculateMaxAfford(game.buildings[what], true) : game.global.buyAmt);
}
}
}
if (isItIn == "portal"){
var resAppend = (game.global.kongBonusMode) ? " Bonus Points" : " Helium Canisters";
var perkItem = game.portal[what];
if (!perkItem.max || perkItem.max > perkItem.level + perkItem.levelTemp) costText = prettify(getPortalUpgradePrice(what)) + resAppend;
else costText = "";
if (game.global.buyAmt == "Max") what += " X " + getPerkBuyCount(what);
else if (game.global.buyAmt > 1) what += " X " + game.global.buyAmt;
tooltipText += " <b>(You have spent " + prettify(perkItem.heliumSpent + perkItem.heliumSpentTemp) + " Helium on this Perk)</b>";
what = what.replace("_", " ");
}
if (isItIn == "equipment"){
costText = canAffordBuilding(what, false, true, true);
if (what == "Shield" && game.equipment.Shield.blockNow){
var blockPerShield = game.equipment.Shield.blockCalculated + (game.equipment.Shield.blockCalculated * game.jobs.Trainer.owned * (game.jobs.Trainer.modifier / 100));
tooltipText += " (" + prettify(blockPerShield) + " after Trainers)";
}
if (game.global.buyAmt != 1) {
what += " X " + ((game.global.buyAmt == "Max") ? calculateMaxAfford(game.equipment[what], false, true) : game.global.buyAmt);
}
}
if (isItIn == "upgrades"){