-
Notifications
You must be signed in to change notification settings - Fork 0
/
CCC-libs.js
3753 lines (3634 loc) · 266 KB
/
CCC-libs.js
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
var __VERSION__ = "1.8",
__DEBUG__ = false;
if (typeof CookieCheat === "undefined") {
var CookieCheat = {
models: {},
views: {},
currentTab: "tools",
collections: {},
cookieToKeep: 0,
// CookHeaven: {},
oldBeautify: Beautify,
oldGameFuncs: {
RefreshStore: new Function(Game.RefreshStore.toString().replace(/^function[\s\S]+?{/, '').replace(/}$/, 'if (CookieCheat.currentTab === "tools") $("#optimalBuying").html(CookieCheat.optimalBuyingUpgradesHtml()); else CookieCheat.optimalBuyingUpgradesHtml();')),
RebuildUpgrades: new Function(Game.RebuildUpgrades.toString().replace(/^function[\s\S]+?{/, '').replace(/}$/, 'CookieCheat.optimalBuyingUpgradesHtml();'))
},
miscVars: {
objectsAchievements: {
0: {
1: "Click",
2: "Double-click",
50: "Mouse wheel",
100: "Of Mice and Men",
200: "The Digital"
},
1: {
1: "Grandma's cookies",
50: "Sloppy kisses",
100: "Retirement home",
150: "Friend of the ancients",
200: "Ruler of the ancients"
},
2: {
1: "My first farm",
50: "Reap what you sow",
150: "Perfect Agriculture",
100: "Farm ill"
},
3: {
1: "Production chain",
50: "Industrial revolution",
150: "Ultimate automation",
100: "Global warming"
},
4: {
1: "You know the drill",
50: "Excavation site",
150: "Can you dig it",
100: "Hollow the planet"
},
5: {
1: "Expedition",
50: "Galactic highway",
150: "Type II civilization",
100: "Far far away"
},
6: {
1: "Transmutation",
50: "Transmogrification",
150: "Gild wars",
100: "Gold member"
},
7: {
1: "A whole new world",
50: "Now you're thinking",
150: "Brain-split",
100: "Dimensional shift"
},
8: {
1: "Time warp",
50: "Alternate timeline",
150: "Time duke",
100: "Rewriting history"
},
9: {
1: "Antibatter",
50: "Quirky quarks",
100: "It does matter!",
150: "Molecular maestro"
},
10: {
1: "Lone photon",
50: "Dazzling glimmer",
100: "Blinding flash",
150: "Unending glow"
}
},
upgradesGenericsFunctions: {
modifyObjectCps: [
["Reinforced index finger", 0],
["Thousand fingers", 0],
["Million fingers", 0],
["Billion fingers", 0],
["Trillion fingers", 0],
["Quadrillion fingers", 0],
["Ambidextrous", 0],
["Carpal tunnel prevention cream", 0],
["Sextillion fingers", 0],
["Quintillion fingers", 0],
["Forwards from grandma", 1],
["One mind", 1],
["Communal brainsweep", 1],
["Steel-plated rolling pins", 1],
["Lubricated dentures", 1],
["Prune juice", 1],
["Double-thick glasses", 1],
["Farmer grandmas", 1],
["Worker grandmas", 1],
["Miner grandmas", 1],
["Cosmic grandmas", 1],
["Transmuted grandmas", 1],
["Altered grandmas", 1],
["Grandmas' grandmas", 1],
["Antigrandmas", 1],
["Rainbow grandmas", 1],
["Bingo center/Research facility", 1],
["Ritual rolling pins", 1],
["Elder Pact", 1],
["Cheap hoes", 2],
["Fertilizer", 2],
["Cookie trees", 2],
["Genetically-modified cookies", 2],
["Gingerbread scarecrows", 2],
["Sturdier conveyor belts", 3],
["Child labor", 3],
["Sweatshop", 3],
["Radium reactors", 3],
["Recombobulators", 3],
["Sugar gas", 4],
["Megadrill", 4],
["Ultradrill", 4],
["Ultimadrill", 4],
["H-bomb mining", 4],
["Vanilla nebulae", 5],
["Wormholes", 5],
["Frequent flyer", 5],
["Warp drive", 5],
["Chocolate monoliths", 5],
["Antimony", 6],
["Essence of dough", 6],
["True chocolate", 6],
["Ambrosia", 6],
["Aqua crustulae", 6],
["Ancient tablet", 7],
["Insane oatling workers", 7],
["Soul bond", 7],
["Sanity dance", 7],
["Brane transplant", 7],
["Flux capacitors", 8],
["Time paradox resolver", 8],
["Quantum conundrum", 8],
["Causality enforcer", 8],
["Yestermorrow comparators", 8],
["Sugar bosons", 9],
["String theory", 9],
["Large macaron collider", 9],
["Big bang bake", 9],
["Reverse cyclotrons", 9],
["Gem polish", 10],
["9th color", 10],
["Chocolate light", 10],
["Grainbow", 10],
["Pure cosmic light", 10]
],
modifyPercentCps: [
["Oatmeal raisin cookies", 5],
["Peanut butter cookies", 5],
["Plain cookies", 5],
["Sugar cookies", 5],
["Coconut cookies", 5],
["White chocolate cookies", 5],
["Macadamia nut cookies", 5],
["Double-chip cookies", 10],
["White chocolate macadamia nut cookies", 10],
["All-chocolate cookies", 10],
["Dark chocolate-coated cookies", 15],
["White chocolate-coated cookies", 15],
["Eclipse cookies", 15],
["Zebra cookies", 15],
["Snickerdoodles", 15],
["Stroopwafels", 15],
["Macaroons", 15],
["Empire biscuits", 15],
["British tea biscuits", 15],
["Chocolate british tea biscuits", 15],
["Round british tea biscuits", 15],
["Round chocolate british tea biscuits", 15],
["Round british tea biscuits with heart motif", 15],
["Round chocolate british tea biscuits with heart motif", 15],
["Madeleines", 20],
["Palmiers", 20],
["Palets", 20],
["Sablés", 20],
["Caramoas", 25],
["Sagalongs", 25],
["Shortfoils", 25],
["Win mints", 25],
["Fig gluttons", 25],
["Loreols", 25],
["Jaffa cakes", 25],
["Grease's cups", 25],
["Skull cookies", 20],
["Ghost cookies", 20],
["Bat cookies", 20],
["Slime cookies", 20],
["Pumpkin cookies", 20],
["Eyeball cookies", 20],
["Spider cookies", 20],
["Christmas tree biscuits", 20],
["Snowflake biscuits", 20],
["Snowman biscuits", 20],
["Holly biscuits", 20],
["Candy cane biscuits", 20],
["Bell biscuits", 20],
["Present biscuits", 20],
["Increased merriness", 15],
["Improved jolliness", 15],
["A lump of coal", 1],
["An itchy sweater", 1],
["Pure heart biscuits", 25],
["Ardent heart biscuits", 25],
["Sour heart biscuits", 25],
["Weeping heart biscuits", 25],
["Golden heart biscuits", 25],
["Eternal heart biscuits", 25],
["Specialized chocolate chips", 1],
["Designer cocoa beans", 2],
["Underworld ovens", 3],
["Exotic nuts", 4],
["Kitten helpers", function () {return (Game.milkProgress * 0.05);}],
["Kitten workers", function () {return (Game.milkProgress * 0.1);}],
["Kitten engineers", function () {return (Game.milkProgress * 0.2);}],
["Kitten overseers", function () {return (Game.milkProgress * 0.2);}],
["Arcane sugar", 5],
["Heavenly chip secret", function () {return (parseFloat(Game.prestige['Heavenly chips']) * 0.02 * 0.05);}],
["Heavenly cookie stand", function () {return (parseFloat(Game.prestige['Heavenly chips']) * 0.02 * 0.25);}],
["Heavenly bakery", function () {return (parseFloat(Game.prestige['Heavenly chips']) * 0.02 * 0.5);}],
["Heavenly confectionery", function () {return (parseFloat(Game.prestige['Heavenly chips']) * 0.02 * 0.75);}],
["Heavenly key", function () {return (parseFloat(Game.prestige['Heavenly chips']) * 0.02 * 1);}]
],
addCpsForObjectUpgrades: function (arr) {
_.each(arr, function (item) {
var upgradeName = item[0];
if (!Game.Upgrades[upgradeName])
console.log('Upgrade [' + upgradeName + '] Doesnt exist.');
Game.Upgrades[upgradeName].cps = CookieCheat.miscVars.upgradesGenericsFunctions.getCpsForUpgradeFunction(item[1], upgradeName);
Game.Upgrades[upgradeName].realCps = CookieCheat.miscVars.upgradesGenericsFunctions.takeCareOfAchievements();
});
},
getCpsForUpgradeFunction: function (objId, upgradeName) {
var pattern = new RegExp('Game\\\.Has\\\([\'"]' + upgradeName + '[\'"]\\)', 'g');
var cpsFuncModif = new Function(Game.ObjectsById[objId].cps.toString().replace(/}[^}]*?$/, "").replace(/^function[^{]+?{/, "").replace(pattern, 1));
return function () {
return ((cpsFuncModif() - Game.ObjectsById[objId].cps()) * Game.ObjectsById[objId].amount);
}
},
getCpsForPercentUpgrade: function (percent) {
if (typeof percent === "number")
var nb = percent * 0.01;
return function () {
return (Game.cookiesPs * (1 + (nb || percent())) - Game.cookiesPs);
}
},
addCpsForPercentUpgrades: function (arr) {
_.each(arr, function (item) {
var upgradeName = item[0];
Game.Upgrades[upgradeName].cps = CookieCheat.miscVars.upgradesGenericsFunctions.getCpsForPercentUpgrade(item[1]);
Game.Upgrades[upgradeName].realCps = CookieCheat.miscVars.upgradesGenericsFunctions.takeCareOfAchievements();
});
},
achievsForAllObjects: function () {
_.each(Game.ObjectsById, function (item) {
var objectName = item.name;
Game.Objects[objectName].realCps = CookieCheat.miscVars.upgradesGenericsFunctions.takeCareOfAchievements();
});
},
takeCareOfAchievements: function () {
return function () {
var isUpgrade = this instanceof Game.Upgrade;
var isObject = this instanceof Game.Object;
var nb = 0;
if (isObject) {
if (this.amount === 0 && !_.isUndefined(CookieCheat.miscVars.objectsAchievements[this.id]) && !_.isUndefined(CookieCheat.miscVars.objectsAchievements[this.id][1]) && !Game.HasAchiev(CookieCheat.miscVars.objectsAchievements[this.id][1]))
nb++;
if (this.amount === 1 && !_.isUndefined(CookieCheat.miscVars.objectsAchievements[this.id]) && !_.isUndefined(CookieCheat.miscVars.objectsAchievements[this.id][2]) && !Game.HasAchiev(CookieCheat.miscVars.objectsAchievements[this.id][2]))
nb++;
if (this.amount === 49 && !_.isUndefined(CookieCheat.miscVars.objectsAchievements[this.id]) && !_.isUndefined(CookieCheat.miscVars.objectsAchievements[this.id][50]) && !Game.HasAchiev(CookieCheat.miscVars.objectsAchievements[this.id][50]))
nb++;
if (this.amount === 99 && !_.isUndefined(CookieCheat.miscVars.objectsAchievements[this.id]) && !_.isUndefined(CookieCheat.miscVars.objectsAchievements[this.id][100]) && !Game.HasAchiev(CookieCheat.miscVars.objectsAchievements[this.id][100]))
nb++;
if (this.amount === 149 && !_.isUndefined(CookieCheat.miscVars.objectsAchievements[this.id]) && !_.isUndefined(CookieCheat.miscVars.objectsAchievements[this.id][150]) && !Game.HasAchiev(CookieCheat.miscVars.objectsAchievements[this.id][150]))
nb++;
if (this.amount === 199 && !_.isUndefined(CookieCheat.miscVars.objectsAchievements[this.id]) && !_.isUndefined(CookieCheat.miscVars.objectsAchievements[this.id][200]) && !Game.HasAchiev(CookieCheat.miscVars.objectsAchievements[this.id][200]))
nb++;
if (!Game.HasAchiev('Builder') && Game.BuildingsOwned === 99)
nb++;
if (!Game.HasAchiev('Architect') && Game.BuildingsOwned === 399)
nb++;
if (!Game.HasAchiev('Engineer') && Game.BuildingsOwned === 799)
nb++;
var oneOfEach = 1;
var mathematician = 1;
var base10 = 1;
var centennial = 1;
for (var i = 0; i < Game.ObjectsById.length; i++) {
if (i === this.id)
continue;
var obj = Game.ObjectsById[i];
if (obj.amount == 0)
oneOfEach = 0;
if (obj.amount < Math.min(128, Math.pow(2, (Game.ObjectsById.length - obj.id) - 1)))
mathematician = 0;
if (obj.amount < (Game.ObjectsById.length - obj.id) * 10)
base10 = 0;
if (obj.amount < 100)
centennial = 0;
}
if (!Game.HasAchiev('One with everything') && oneOfEach && this.amount === 0)
nb++;
if (!Game.HasAchiev('Mathematician') && mathematician && this.amount === Math.min(128, Math.pow(2, (Game.ObjectsById.length - this.id) - 1)) - 1)
nb++;
if (!Game.HasAchiev('Base 10') && base10 && this.amount === (Game.ObjectsById.length - this.id) * 10 - 1)
nb++;
if (!Game.HasAchiev('Centennial') && centennial && this.amount === 99)
nb++;
}
if (isUpgrade) {
if (!Game.HasAchiev("Enhancer") && Game.UpgradesOwned === 19)
nb++;
if (!Game.HasAchiev("Augmenter") && Game.UpgradesOwned === 49)
nb++;
if (!Game.HasAchiev("Upgrader") && Game.UpgradesOwned === 99)
nb++;
if (!Game.HasAchiev("Wholesome") && this.name === "Heavenly key")
nb++;
var howManyHalloweenUpgrades = 0;
if (Game.Has('Skull cookies')) howManyHalloweenUpgrades++;
if (Game.Has('Ghost cookies')) howManyHalloweenUpgrades++;
if (Game.Has('Bat cookies')) howManyHalloweenUpgrades++;
if (Game.Has('Slime cookies')) howManyHalloweenUpgrades++;
if (Game.Has('Pumpkin cookies')) howManyHalloweenUpgrades++;
if (Game.Has('Eyeball cookies')) howManyHalloweenUpgrades++;
if (Game.Has('Spider cookies')) howManyHalloweenUpgrades++;
var test = this.name === 'Skull cookies' || this.name === 'Ghost cookies' || this.name === 'Bat cookies' ||
this.name === 'Slime cookies' || this.name === 'Pumpkin cookies' || this.name === 'Eyeball cookies' || this.name === 'Spider cookies';
if (!Game.HasAchiev("Spooky cookies") && howManyHalloweenUpgrades === 6 && test)
nb++;
var howManyGrandmasUpgrades = 0;
if (Game.Has('Farmer grandmas')) howManyGrandmasUpgrades++;
if (Game.Has('Worker grandmas')) howManyGrandmasUpgrades++;
if (Game.Has('Miner grandmas')) howManyGrandmasUpgrades++;
if (Game.Has('Cosmic grandmas')) howManyGrandmasUpgrades++;
if (Game.Has('Transmuted grandmas')) howManyGrandmasUpgrades++;
if (Game.Has('Altered grandmas')) howManyGrandmasUpgrades++;
if (Game.Has('Grandmas\' grandmas')) howManyGrandmasUpgrades++;
if (Game.Has('Antigrandmas')) howManyGrandmasUpgrades++;
if (Game.Has('Rainbow grandmas')) howManyGrandmasUpgrades++;
var test = this.name === 'Antigrandmas' || this.name === 'Farmer grandmas' || this.name === 'Worker grandmas' || this.name === 'Altered grandmas' ||
this.name === 'Miner grandmas' || this.name === 'Rainbow grandmas' || this.name === 'Cosmic grandmas' || this.name === 'Transmuted grandmas' || this.name === 'Grandmas\' grandmas';
if (!Game.HasAchiev("Elder") && howManyGrandmasUpgrades === 6 && test)
nb++;
}
var percent = (0.04 * nb) * (0.05 * Game.Has("Kitten helpers") + 0.1 * Game.Has("Kitten workers") + 0.2 * Game.Has("Kitten engineers") + 0.2 * Game.Has("Kitten overseers"));
var diffCps = (Game.cookiesPs * (1 + percent) - Game.cookiesPs);
return (this.cps() + diffCps);
}
}
}
},
resetCookieCheat: function () {
if (confirm("You will lose all your saves. Are you sure ?")) {
_.each(CookieCheat.collections, function (collection, key) {
while (collection.models.length > 0) {
if (typeof collection.models[0].stop === "function")
collection.models[0].stop();
collection.models[0].clear();
collection.remove(collection.models[0]);
}
collection.reset();
});
_.each(CookieCheat.models, function (model, key) {
model.reset();
delete model;
});
for (var k in localStorage) { if (k.indexOf("CookieClickerCheats") === 0) delete localStorage[k];}
CookieCheat.miscVars.upgradesGenericsFunctions.addCpsForObjectUpgrades(CookieCheat.miscVars.upgradesGenericsFunctions.modifyObjectCps);
CookieCheat.miscVars.upgradesGenericsFunctions.addCpsForPercentUpgrades(CookieCheat.miscVars.upgradesGenericsFunctions.modifyPercentCps);
CookieCheat.miscVars.upgradesGenericsFunctions.achievsForAllObjects();
CookieCheat.views = {};
CookieCheat.collections = {};
CookieCheat.models = {};
CookieCheat.currentNumFormat = "restore";
CookieCheat.shouldShowTimeLeft = "restore";
CookieCheat.changeBeautify("restore");
CookieCheat.processDesc("restore");
CookieCheat.initAllBackbone();
Game.UpdateMenu();
}
},
howManySecondsUntilThisAmount: function (amount) {
if (Game.cookiesPs == 0)
return Infinity;
var res = Math.floor((amount - Game.cookies) / Game.cookiesPs);
return (res > 0 ? res : 0);
},
optimalBuyingHtml: function () {
CookieCheat.miscVars.objectsOrder = _.map(Game.ObjectsById, function (obj) {
return {
id: obj.id,
name: obj.name,
val: 10000 * obj.realCps() / obj.price
};
}).sort(function(a, b) {
return b.val - a.val;
});
_.each(CookieCheat.miscVars.objectsOrder, function (me, index) {
var color = (index === 0 ? "#0f0" : (index === Game.ObjectsById.length - 1 ? '#f00' : '#ff0'));
$('#product' + me.id).find('.price').css("color", color);
CookieCheat.miscVars.objectsOrder[index].color = color;
});
},
optimalBuyingUpgradesHtml: function () {
CookieCheat.optimalBuyingHtml();
var res = "";
var nb0 = 0;
var all = CookieCheat.miscVars.objectsOrder;
var bestObjectVal = CookieCheat.miscVars.objectsOrder[0].val;
var worstObjectVal = CookieCheat.miscVars.objectsOrder[CookieCheat.miscVars.objectsOrder.length - 1].val;
_.each(_.map(Game.UpgradesInStore, function (upgrade, index) {
if (typeof upgrade.realCps !== "function")
nb0++;
return {
id: upgrade.id,
name: upgrade.name,
idInStore: index,
val: 10000 * (typeof upgrade.realCps === "function" ? upgrade.realCps() : 0) / upgrade.basePrice
};
}).sort(function(a, b) {
return b.val - a.val;
}), function (me, index) {
if (typeof Game.Upgrades[me.name].realCps === "function") {
var color = (index === 0 ? "#0f0" : (index === Game.UpgradesInStore.length - nb0 - 1 ? '#f00' : '#ff0'));
if (me.val > bestObjectVal || me.val < worstObjectVal)
color = (me.val > bestObjectVal ? "#0ff" : "#f00");
me.color = color;
all.push(me);
$('#upgrade' + me.idInStore).html('<div style="background-color:' + color + ';height:10px;width:100%;"></div>');
}
else
$('#upgrade' + me.idInStore).html('<div style="background-color:#000;height:10px;width:100%;"></div>');
});
_.each(all.sort(function(a, b) {
return b.val - a.val;
}), function (me) {
res += '<span style="color:' + me.color + ';font-family: Kavoon;">' + me.name + '</span><br><br>';
});
return res;
},
upgradeBlacklist: ['Gold hoard', "Neuromancy", "Ultrascience", "Elder Covenant", "Revoke Elder Covenant", "One mind", "Season switcher", "Lovesick biscuit", "Festive biscuit", "Ghostly biscuit", "Fool's biscuit"],
strForFeatures: {
topHeadBand: function () {
return '<hr>' +
'<div id="tabs">' +
'<input type="button" class="superTabBtn superGood superBtn' + (CookieCheat.currentTab === "tools" ? " selectedTab" : "") + '" value="Tools" onclick="CookieCheat.changeTab(\'tools\')">' +
'<input type="button" class="superTabBtn superBad superBtn' + (CookieCheat.currentTab === "cheats" ? " selectedTab" : "") + '" value="Cheats" onclick="CookieCheat.changeTab(\'cheats\')">' +
'<input type="button" class="superTabBtn superWarning superBtn' + (CookieCheat.currentTab === "mods" ? " selectedTab" : "") + '" value="Mods" onclick="CookieCheat.changeTab(\'mods\')">' +
'</div>' +
'<div class="section ' + (CookieCheat.currentTab === "tools" ? " superGood" : (CookieCheat.currentTab === "mods" ? " superWarning" : " superBad")) + '" style="text-decoration:underline;font-size:25px;">' +
'<hr>' +
String.capitalize(CookieCheat.currentTab) + ("") +
'</div>' +
'<hr>';
},
cheats: function () {
var a = (function () {
var nb = $('.numberToSet').val();
var id = $('#selectBuildingToSet').val();
if (id === 'all') {
_.each(Game.ObjectsById, function (me) {
me.amount = nb;
if (_.isFunction(me.buyFunction))
me.buyFunction();
me.refresh();
});
}
else {
var me = Game.ObjectsById[id];
me.amount = nb;
if (_.isFunction(me.buyFunction))
me.buyFunction();
me.refresh();
}
Game.storeToRebuild=1;
Game.recalculateGains=1;
}).toString();
return '<div class="subsection"><br>' +
'<br>' +
'<br>' +
'<div class="title">Give yourself some cookies</div>'+ // Cookies to earn
'<div class="listing"><small>(Note : You can use negative numbers to remove cookies. (<span style="font-style: italic;">"God... Why would you do that..?"</span> - CookieGod).)</small></div><br>'+
'<div class="listing" id="earnCookieDiv">' +
'<p class="superFont">' +
'How many ? ' +
'<input type="number" class="numberToEarn imAState superFont" value="0" style="width:25%"/>' +
'<span class="infoToDisplay superGood simpleInfo superRight"></span>' +
'</p>' +
'</div>' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">Give yourself some HEAVENLY CHIPS</div>'+ // Heavenly chips to earn
'<div class="listing"><small>(Note : You can use negative numbers to remove Heavenly chips. (<span style="font-style: italic;">"That.. Is... Really... DUMB !"</span> - CookieGod).)</small></div><br>'+
'<div class="listing" id="earnHeavenDiv">' +
'<p class="superFont">' +
'How many ? ' +
'<input type="number" class="numberToEarn imAState superFont" value="0" style="width:25%"/>' +
'<span class="infoToDisplay superGood simpleInfo superRight"></span>' +
'</p>' +
'</div>' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">AutoClick Cookie</div>'+ // AutoClick Cookie
'<div class="listing"><small>(Note : I can\'t guarantee that the cheat will click as fast as you want. It depends on your computer.)</small></div><br>'+
'<div class="listing" id="autoClickDiv">' +
'<a id="autoClickButton" class="superBtn superGood">AutoClick</a>' +
'<span class="superFont imAState">State :</span> <span class="superGood goodState">ON</span>/<span class="badState superBad currentState">OFF</span>' +
'<div id="clickAmount" class="simpleInfo superRight"></div>' +
'<br><br><input class="imAState" id="clickingSpeed" type="range" name="speed" min="1" max="1000" step="1" style="width:100%">' +
'<br><br><span id="clickingSpeedText" class="superFont imAState"></span>' +
'</div>' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">AutoClick Wrinklers</div>'+ // AutoClick Wrinklers
'<div class="listing"><small>(Note : Hello, I\'m a note.)</small></div><br>'+
'<div class="listing" id="autoClickWrinklersDiv">' +
'<a id="autoClickWrinklersButton" class="superBtn superGood">Kill them all !</a>' +
'<span class="superFont imAState">State :</span> <span class="superGood goodState">ON</span>/<span class="badState superBad currentState">OFF</span>' +
'<div id="clickWrinklersAmount" class="simpleInfo superRight"></div>' +
'</div>' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">Set building amount</div>'+ // Set building amount
'<div class="listing"><small>(Note : I know you\'ll crash your game with this but... CookieCheat must do ANYTHING. (Yes, even crash your game).)</small></div>'+
'<div class="listing"><small>(Note : Don\'t be too greedy... (I know you will...))</small></div><br>'+
'<div class="listing" id="setBuildingDiv">' +
'<br>' +
'<p class="superFont">' +
'Which building ?' +
'<select id="selectBuildingToSet" class="imAState superFont">' +
'<option value="all">ALL !!!</option>' +
(function () {var r = "";for(var i in Game.ObjectsById){r+='<option value="'+i+'">'+Game.ObjectsById[i].name+'</option>';}return r;})() +
'</select>' +
'</p>' +
'<br>' +
'<p class="superFont">' +
'How many ?' +
'<input type="number" class="numberToSet imAState superFont" value="0" style="width:25%"/>' +
'</p>' +
'<br>' +
'<p class="superFont">' +
'<a id="setBuildingButton" class="superBtn superGood" onclick="' +
(a.substring(a.indexOf('{') + 1, a.lastIndexOf('}'))).replace(/"/g, "'") +
'">Set it ! OMFG HURRY UP I WANT A LOT OF THAT THINGS !!!!</a>' +
'</p>' +
'</div>' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">AutoClick Reindeers</div>'+ // AutoClick Reindeers
'<div class="listing" id="autoReindeerClickDiv">' +
'<a id="autoReindeerClickButton" class="superBtn superGood">AutoReindeerClick</a>' +
'<span class="superFont imAState">State :</span> <span class="superGood goodState">ON</span>/<span class="badState superBad currentState">OFF</span>' +
'<div id="reindeerClickAmount" class="simpleInfo superRight"></div>' +
'</div>' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">AutoSpawn Golden Cookies</div>'+ // AutoSpawn golden Cookie
'<div class="listing"><small>(Note : I can\'t guarantee that the cheat will spawn golden cookies as fast as you want. It depends on your computer.)</small></div>'+
'<div class="listing"><small>(Note : Sometimes, "legit" golden cookies will spawn. They do not depend on my cheat.)</small></div><br>'+
'<div class="listing" id="autoSpawnDiv">' +
'<a id="autoSpawnButton" class="superBtn superGood">AutoSpawn</a>' +
'<span class="superFont imAState">State :</span> <span class="superGood goodState">ON</span>/<span class="badState superBad currentState">OFF</span>' +
'<div id="spawnAmount" class="simpleInfo superRight"></div>' +
'<br><br><input class="imAState" id="spawningSpeed" type="range" name="speed" min="100" max="600000" step="100" style="width:100%">' +
'<br><br><span id="spawningSpeedText" class="superFont imAState"></span>' +
'</div>' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">AutoClick GoldenCookies</div>'+ // AutoClick GoldenCookies
'<div class="listing" id="autoGoldenClickDiv">' +
'<a id="autoGoldenClickButton" class="superBtn superGood">AutoGoldenClick</a>' +
'<span class="superFont imAState">State :</span> <span class="superGood goodState">ON</span>/<span class="badState superBad currentState">OFF</span>' +
'<div id="goldenClickAmount" class="simpleInfo superRight"></div>' +
'</div>' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">Spawn GoldenCookies</div>'+ // Spawn GoldenCookie
'<div class="listing" id="goldenSpawnDiv">' +
'<a id="goldenSpawnButton" class="superBtn superGood">Spawn a golden cookie NOW ! <span style="font-size:50%;">...please</span></a>' +
'<div id="goldenSpawnedAmount" class="simpleInfo superRight"></div>' +
'</div></div>';
},
tools: function () {
var a = (function () {
if (!confirm('Do you really want to sell ALL your buildings ?'))
return;
_.each(Game.ObjectsById, function (obj) {
while (obj.amount > 1) {
var price=obj.basePrice*Math.pow(Game.priceIncrease,obj.amount);
price=Math.floor(price*0.5);
Game.cookies += price;
obj.amount--;
Game.BuildingsOwned--;
}
obj.sell();
});
}).toString();
return '<div class="subsection"><br>' +
'<br>' +
'<br>' +
'<div class="title">Save manager</div>'+ // Save manager
'<div class="listing">' +
'<div id="newSaveForm">' +
'<form>' +
'<p class="superFont">' +
'Custom save name :' +
'<input type="text" id="enterNameSave" class="superRight superFont" style="width:50%"></input>' +
'</p>' +
'<br />' +
'<br />' +
'<p class="superFont">' +
'Save code :' +
'<select id="selectSaveCode" class="superRight superFont">' +
'<option value="' + CookieCheat.miscVars.newGame + '">New game</option>' +
'<option value="current">--Current game--</option>' +
'<option value="manual">--Import a save--</option>' +
'</select>' +
'</p>' +
'<br />' +
'<br />' +
'<input type="text" id="saveCode" class="superRight superFont" disabled="1" value="' + CookieCheat.miscVars.newGame + '" style="width:100%;"></input>' +
'<br />' +
'<br />' +
'<p style="text-align:center">' +
'<input type="submit" id="newSaveButton" class="submit superBtn superGood" value="Give me that save !" />' +
'</p>' +
'</form>' +
'</div>' +
'<br /><br />' +
'<div class="superHidden" id="savesListContainer"></div>'+
'</div>' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">Cookie amount to keep safely (It\'s soooo safe)</div>'+ // Cookies to keep
'<div class="listing" id="safeCookieDiv">' +
'<p>' +
'<p>' +
'<a class="superBtn" id="fixCookies" style="font-size:1em;color:#333;">Fix my cookies please... (Infinity or NaN cookies ? Push this button and let the CookieGod work !)</a>' +
'</p>' +
'<br><br>' +
'<p>' +
'<a class="superBtn superRadioBtn _pseudoRadio" id="checkBoxToKeepForLucky" style="font-size:1.2em;">Automatically keep cookies to maximize "Lucky!".</a>' +
'<span class="infoToDisplay superGood simpleInfo superRight"></span>' +
'</p>' +
'<br><br>' +
'<p>' +
'<a class="superBtn superRadioBtn _pseudoRadio" id="checkBoxToKeepForFrenzy" style="font-size:1.2em;">Automatically keep cookies to maximize "Lucky!+Frenzy!".</a>' +
'</p>' +
'<br><br>' +
'<p>' +
'<a class="superBtn superRadioBtn _pseudoRadio" id="checkBoxToKeepAny" style="font-size:1.2em;">By yourself ? Game boy.</a>' +
'<input type="number" class="numberToKeep imAState superFont" value="0" style="width:25%"/>' +
'<span class="whatAboutYou superGood simpleInfo superRight"></span>' +
'</p>' +
'<p>' +
'<br>' +
'<input type="checkbox" id="hitMePlease"/>' +
'<label for="hitMePlease" class="superBad" id="hitLabel">Don\'t let me break this limit, CookieGod !</label>' +
'<span class="cookieGod superBad simpleInfo superRight">The CookieGod doesn\'t care</span>' +
'</p>' +
'</p>' +
'</div>'+
'<br>' +
'<br>' +
'<br>' +
'<div class="title">Optimal Building order</div>'+ // Optimal buying
'<div class="listing" id="optimalBuying">' +
CookieCheat.optimalBuyingUpgradesHtml() +
'</div>' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">Sell buildings</div>'+ // Sell everything !!!
'<div class="listing">' +
'<a class="superBtn superBad" onclick="' + (a.substring(a.indexOf('{') + 1, a.lastIndexOf('}'))).replace(/"/g, "'") + '" style="font-size:1.2em;">Sell ALL your buildings (EVERYTHING !!!)</a>' +
(function () {
var res = "";
_.each(Game.ObjectsById, function (obj) {
res += "<br><br><br>";
res += '<a class="superFont superBtn superWarning" onclick="' +
'var objName = \'' + obj.name + '\';' +
'var obj = Game.Objects[objName];' +
'var goal = Game.Objects[objName].amount - 10;' +
'goal = (goal < 0 ? goal = 0 : goal = goal);' +
'if (!confirm(\'Do you really want to sell \' + (Game.Objects[objName].amount - goal) + \' \' + objName + \' ?\'))' +
'return;' +
'goal++;' +
'while (obj.amount > goal) {' +
'var price=obj.basePrice*Math.pow(Game.priceIncrease,obj.amount);' +
'price=Math.floor(price*0.5);' +
'Game.cookies += price;' +
'obj.amount--;' +
'Game.BuildingsOwned--;' +
'}' +
'obj.sell();" style="font-size:1.2em;">Sell 10 ' + obj.name + '</a>\t';
res += '<a class="superFont superBtn superBad" onclick="' +
'var objName = \'' + obj.name + '\';' +
'var obj = Game.Objects[objName];' +
'if (!confirm(\'Do you really want to sell ALL your \' + objName + \' ?\'))' +
'return;' +
'while (obj.amount > 1) {' +
'var price=obj.basePrice*Math.pow(Game.priceIncrease,obj.amount);' +
'price=Math.floor(price*0.5);' +
'Game.cookies += price;' +
'obj.amount--;' +
'Game.BuildingsOwned--;' +
'}' +
'obj.sell();" style="font-size:1.2em;">Sell all your ' + obj.name + '</a>';
});
return res;
})() +
'</div>' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">AutoBuy Buildings</div>'+ // AutoBuy buildings
'<div class="listing">' +
'<div id="newForm">' +
'<form>' +
'<p class="superFont">' +
'Building : ' +
'<select id="selectBuilding" class="superRight superFont">' +
'<option value="all">ALL !!!</option>' +
'</select>' +
'</p>' +
'<br />' +
'<br />' +
'<p class="superFont">' +
'Amount to reach : ' +
'<input type="number" class="superRight number superFont" min="0" max="1000" value="0"/>' +
'</p>' +
'<br />' +
'<br />' +
'<p style="text-align:center">' +
'<input type="submit" id="newAutoBuyBuildingsButton" class="submit superBtn superGood" value="Add it !" />' +
'</p>' +
'</form>' +
'</div>' +
'<br /><br />' +
'<div class="superHidden" id="buildingsListContainer"></div>'+
'</div>' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">AutoBuy Upgrades</div>'+ // AutoBuy upgrades
'<div class="listing">' +
'<div id="newUpgradeForm">' +
'<form>' +
'<p class="superFont">' +
'Upgrade : ' +
'<select id="selectUpgrade" class="superRight superFont" style="width:70%;">' +
'<option value="all">ALL !!!</option>' +
'</select>' +
'</p>' +
'<br />' +
'<br />' +
'<p class="superFont">' +
'Or enter its name here : ' +
'<input type="text" id="enterNameUpgrade" class="superRight superFont" style="width:40%"></input>' +
'</p>' +
'<br />' +
'<br />' +
'<p style="text-align:center">' +
'<input type="submit" id="newAutoBuyUpgradesButton" class="submit superBtn superGood" value="Buy it !" />' +
'</p>' +
'</form>' +
'</div>' +
'<br /><br />' +
'<div class="superHidden" id="upgradesListContainer"></div>'+
'</div></div>';
},
mods: function () {
var a = (function () {
var name = $('#fontSet').val();
CookieCheat.changeBeautify(name);
}).toString();
return '<div class="subsection">' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">Modify the number display</div>'+ // Beautify
'<div class="listing">' +
'<p class="superFont">' +
'Which format do you want ?' +
'<select class="imAState superFont" id="fontSet" onchange="' + (a.substring(a.indexOf('{') + 1, a.lastIndexOf('}'))).replace(/"/g, "'") + '">' +
'<option value="restore">Default</option>' +
(function () {var r = "";for(var i in CookieCheat.numFormats){r+='<option value="'+i+'" + ' + (CookieCheat.currentNumFormat === i ? " selected " : "") + '>'+CookieCheat.lowCamelCaseToSentence(i)+'</option>';}return r;})() +
'</select>' +
'</p>' +
'</div>' +
// '<br>' +
// '<br>' +
// '<br>' +
// '<div class="title">About the remaining time</div>'+ // Remaining time
// '<div class="listing">' +
// '<p class="superFont">' +
// 'Do you want to show the remaining time in buildings/upgrades tooltips ?<br><br>' +
// '<input id="aboutTheTimeLeft" onchange="' + "$('#shouldLabel').toggleClass('superGood', CookieCheat.shouldShowTimeLeft === 'restore').toggleClass('superBad', CookieCheat.shouldShowTimeLeft !== 'restore');CookieCheat.shouldShowTimeLeft = (CookieCheat.shouldShowTimeLeft === 'restore' ? 'hello' : 'restore');CookieCheat.processDesc(CookieCheat.shouldShowTimeLeft);" + '" type="checkbox" ' + (CookieCheat.shouldShowTimeLeft === "restore" ? "" : "checked") + '/>' +
// '<label for="aboutTheTimeLeft" class="' + (CookieCheat.shouldShowTimeLeft === 'restore' ? 'superBad' : 'superGood') + '" id="shouldLabel">I want to see that information !!!!</label>' +
// '</p>' +
// '</div>' +
'<br>' +
'<br>' +
'<br>' +
'<div class="title">Golden cookie effects</div>'+ // Golden cookie choices
'<div class="listing">' +
'<br><br>' +
'<div class="superHidden" id="choicesListContainer"></div>'+
'</div>' +
'</div>';
}
},
processNb: function (amount) {
var result = "", len;
var _results = [];
if (CookieCheat.currentNumFormat === "restore")
return;
_datas = CookieCheat.numFormats[CookieCheat.currentNumFormat];
_.each(_datas, function (data) {
var tmpVal = 0;
tmpVal = Math.floor(amount / data.num);
amount -= (data.num * tmpVal);
if (tmpVal.toString().length < 3)
tmpVal = (tmpVal.toString().length === 2 ? "0" : "00") + tmpVal;
if (tmpVal != 0) {
_results.push({
val: tmpVal,
unit: ((typeof data.plural !== "undefined" && tmpVal > 1) ? data.plural : data.name)
});
}
});
if (_results.length === 0)
_results.push({val: 0, unit: ""});
result = "" + parseInt(_results[0].val, 10) + (_results.length > 1 ? "." + _results[1].val : "") + " " + _results[0].unit;
return result;
},
lowCamelCaseToSentence: function (word, capitalize) {
var res = "";
var wasNum = false;
capitalize = capitalize || true;
_.each(word, function (char) {
if (!_.isNaN(char * 123)) {
if (!wasNum)
res += " " + char;
else
res += char;
wasNum = true;
}
else {
if (char === char.toUpperCase()) { // La lettre est en majuscule
res += " " + char;
}
else
res += (wasNum ? " " : "") + char;
wasNum = false;
}
});
return (capitalize ? String.capitalize(res) : res);
},
changeBeautify: function (name) {
localStorage["CookieClickerCheatsBeautifyThem"] = JSON.stringify(name);
if (name == null || name === "restore")
Beautify = CookieCheat.oldBeautify;
else {
CookieCheat.currentNumFormat = name;
Beautify = CookieCheat.processNb;
}
Game.storeToRebuild = 1;
},
processDesc: function (name, shouldRe) {
shouldRe = _.isUndefined(shouldRe) ? true : (_.isUndefined(CookieCheat.lastUpMenu) ? shouldRe : (Math.abs(CookieCheat.lastUpMenu - new Date().getTime()) > 1000) ? true : false);
localStorage["CookieClickerCheatsShouldShowTimeLeft"] = JSON.stringify(name);
if (name === "restore") {
if (Game.RefreshStore.toString() !== CookieCheat.oldGameFuncs.RefreshStore.toString()) {
Game.RefreshStore = CookieCheat.oldGameFuncs.RefreshStore;
Game.RebuildUpgrades = CookieCheat.oldGameFuncs.RebuildUpgrades;
}
if (_.isUndefined(CookieCheat.objSaves)) {
CookieCheat.objSaves = {};
_.each(Game.ObjectsById, function (me) {
CookieCheat.objSaves[me.name] = {};
CookieCheat.objSaves[me.name].desc = me.desc;
me.desc = CookieCheat.objSaves[me.name].desc;
});
}
else {
_.each(Game.ObjectsById, function (me) {
me.desc = CookieCheat.objSaves[me.name].desc;
});
}
if (_.isUndefined(CookieCheat.upgSaves)) {
CookieCheat.upgSaves = {};
_.each(Game.UpgradesById, function (me) {
CookieCheat.upgSaves[me.name] = {};
CookieCheat.upgSaves[me.name].desc = me.desc;
me.desc = CookieCheat.upgSaves[me.name].desc;
});
}
else {
_.each(Game.UpgradesById, function (me) {
me.desc = CookieCheat.upgSaves[me.name].desc;
});
}
}
else {
if (Game.RefreshStore.toString() === CookieCheat.oldGameFuncs.RefreshStore.toString()) {
Game.RefreshStore = function () {
CookieCheat.processDesc(CookieCheat.shouldShowTimeLeft, false);
var str = '';
for (var i in Game.Objects) {
var me = Game.Objects[i];
str += '<div class="product" ' +
Game.getTooltip('<div style="min-width:300px;"><div style="float:right;"><span class="price">' + Beautify(Math.round(me.price)) + '</span></div><div class="name">' + me.name + '</div>' + '<small>[owned : ' + me.amount + '</small>]<div class="description">' + me.desc + '</div></div>', 0, 0, 'left') +
' id="product' + me.id + '"><div class="icon" id="productIcon' + me.id + '" style="background-image:url(img/' + me.icon + '.png);"></div><div class="content"><div class="title">' + me.displayName + '</div><span class="price">' + Beautify(Math.round(me.price)) + '</span>' + (me.amount > 0 ? ('<div class="title owned">' + me.amount + '</div>') : '') + '</div></div>';
}
l('products').innerHTML = str;
for (var i in Game.Objects) {
var me = Game.Objects[i];
AddEvent(l('product' + me.id), 'mouseover', function (what) {
return function () {
var f = function () {
$('#timeInfo').html((CookieCheat.howManySecondsUntilThisAmount(Game.ObjectsById[what].price) > 0 ? '<span class=' + (CookieCheat.howManySecondsUntilThisAmount(Game.ObjectsById[what].price) > 60 * 60 * 24 ? "superBad":"superWarning")+'>Available in ' + CookieCheat.processMs(1000 * CookieCheat.howManySecondsUntilThisAmount(Game.ObjectsById[what].price)) + '</span>': '<span class="superGood">Already enabled !</span>'));
};
clearInterval(window.memoInterval);
window.memoInterval = setInterval(f, 1000);
};
}(me.id));
AddEvent(l('product' + me.id), 'mouseout', function () {
CookieCheat.processDesc(CookieCheat.shouldShowTimeLeft, true);
clearInterval(window.memoInterval);
});
AddEvent(l('product' + me.id), 'click', function (what) {
return function () {
Game.ObjectsById[what].buy()
};
}(me.id));
}
Game.storeToRebuild = 0;
if (CookieCheat.currentTab == "tools")
$('#optimalBuying').html(CookieCheat.optimalBuyingUpgradesHtml());
else
CookieCheat.optimalBuyingUpgradesHtml();
};
Game.RebuildUpgrades = function () {
CookieCheat.processDesc(CookieCheat.shouldShowTimeLeft, false);
Game.upgradesToRebuild = 0;
var list = [];
for (var i in Game.Upgrades) {
var me = Game.Upgrades[i];
if (!me.bought) {
if (me.unlocked) list.push(me);
}
}
var sortMap = function (a, b) {
if (a.basePrice > b.basePrice) return 1;
else if (a.basePrice < b.basePrice) return -1;
else return 0;
}
list.sort(sortMap);