forked from Trixter9994/Cookie-Clicker-Source-Code
-
Notifications
You must be signed in to change notification settings - Fork 3
/
minigameGarden.js
2016 lines (1905 loc) · 79.3 KB
/
minigameGarden.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 M={};
M.parent=Game.Objects['Farm'];
M.parent.minigame=M;
M.launch=function()
{
var M=this;
M.name=M.parent.minigameName;
M.init=function(div)
{
//populate div with html and initialize values
/*
plants age from 0 to 100
at one point in its lifespan, the plant becomes mature
plants have 4 life stages once planted : bud, sprout, bloom, mature
a plant may age faster by having a higher .ageTick
if a plant has .ageTickR, a random number between 0 and that amount is added to .ageTick
a plant may mature faster by having a lower .mature
a plant's effects depend on how mature it is
a plant can only reproduce when mature
*/
M.plants={
'bakerWheat':{
name:'Baker\'s wheat',
icon:0,
cost:1,
costM:30,
ageTick:7,
ageTickR:2,
mature:35,
children:['bakerWheat','thumbcorn','cronerice','bakeberry','clover','goldenClover','chocoroot','tidygrass'],
effsStr:'<div class="green">• +1% CpS</div>',
q:'A plentiful crop whose hardy grain is used to make flour for pastries.',
onHarvest:function(x,y,age)
{
if (age>=this.mature) M.dropUpgrade('Wheat slims',0.001);
},
},
'thumbcorn':{
name:'Thumbcorn',
icon:1,
cost:5,
costM:100,
ageTick:6,
ageTickR:2,
mature:20,
children:['bakerWheat','thumbcorn','cronerice','gildmillet','glovemorel'],
effsStr:'<div class="green">• +2% cookies per click</div>',
q:'A strangely-shaped variant of corn. The amount of strands that can sprout from one seed is usually in the single digits.',
},
'cronerice':{
name:'Cronerice',
icon:2,
cost:15,
costM:250,
ageTick:0.4,
ageTickR:0.7,
mature:55,
children:['thumbcorn','gildmillet','elderwort','wardlichen'],
effsStr:'<div class="green">• +3% grandma CpS</div>',
q:'Not only does this wrinkly bulb look nothing like rice, it\'s not even related to it either; its closest extant relative is the weeping willow.',
},
'gildmillet':{
name:'Gildmillet',
icon:3,
cost:15,
costM:1500,
ageTick:2,
ageTickR:1.5,
mature:40,
children:['clover','goldenClover','shimmerlily'],
effsStr:'<div class="green">• +1% golden cookie gains</div><div class="green">• +0.1% golden cookie effect duration</div>',
q:'An ancient staple crop, famed for its golden sheen. Was once used to bake birthday cakes for kings and queens of old.',
},
'clover':{
name:'Ordinary clover',
icon:4,
cost:25,
costM:77777,
ageTick:1,
ageTickR:1.5,
mature:35,
children:['goldenClover','greenRot','shimmerlily'],
effsStr:'<div class="green">• +1% golden cookie frequency</div>',
q:'<i>Trifolium repens</i>, a fairly mundane variety of clover with a tendency to produce four leaves. Such instances are considered lucky by some.',
},
'goldenClover':{
name:'Golden clover',
icon:5,
cost:125,
costM:777777777777,
ageTick:4,
ageTickR:12,
mature:50,
children:[],
effsStr:'<div class="green">• +3% golden cookie frequency</div>',
q:'A variant of the ordinary clover that traded its chlorophyll for pure organic gold. Tragically short-lived, this herb is an evolutionary dead-end - but at least it looks pretty.',
},
'shimmerlily':{
name:'Shimmerlily',
icon:6,
cost:60,
costM:777777,
ageTick:5,
ageTickR:6,
mature:70,
children:['elderwort','whiskerbloom','chimerose','cheapcap'],
effsStr:'<div class="green">• +1% golden cookie gains</div><div class="green">• +1% golden cookie frequency</div><div class="green">• +1% random drops</div>',
q:'These little flowers are easiest to find at dawn, as the sunlight refracting in dew drops draws attention to their pure-white petals.',
},
'elderwort':{
name:'Elderwort',
icon:7,
cost:60*3,
costM:100000000,
ageTick:0.3,
ageTickR:0.5,
mature:90,
immortal:1,
noContam:true,
detailsStr:'Immortal',
children:['everdaisy','ichorpuff','shriekbulb'],
effsStr:'<div class="green">• +1% wrath cookie gains</div><div class="green">• +1% wrath cookie frequency</div><div class="green">• +1% grandma CpS</div><div class="green">• immortal</div><div class="gray">• surrounding plants (3x3) age 3% faster</div>',
q:'A very old, long-forgotten subspecies of edelweiss that emits a strange, heady scent. There is some anecdotal evidence that these do not undergo molecular aging.',
onHarvest:function(x,y,age)
{
if (age>=this.mature) M.dropUpgrade('Elderwort biscuits',0.01);
},
},
'bakeberry':{
name:'Bakeberry',
icon:8,
cost:45,
costM:100000000,
ageTick:1,
ageTickR:1,
mature:50,
children:['queenbeet'],
effsStr:'<div class="green">• +1% CpS</div><div class="green">• harvest when mature for +30 minutes of CpS (max. 3% of bank)</div>',
q:'A favorite among cooks, this large berry has a crunchy brown exterior and a creamy red center. Excellent in pies or chicken stews.',
onHarvest:function(x,y,age)
{
if (age>=this.mature)
{
var moni=Math.min(Game.cookies*0.03,Game.cookiesPs*60*30);
if (moni!=0)
{
Game.Earn(moni);
Game.Popup('(Bakeberry)<br>+'+Beautify(moni)+' cookies!',Game.mouseX,Game.mouseY);
}
M.dropUpgrade('Bakeberry cookies',0.015);
}
},
},
'chocoroot':{
name:'Chocoroot',
icon:9,
cost:15,
costM:100000,
ageTick:4,
ageTickR:0,
mature:25,
detailsStr:'Predictable growth',
children:['whiteChocoroot','drowsyfern','queenbeet'],
effsStr:'<div class="green">• +1% CpS</div><div class="green">• harvest when mature for +3 minutes of CpS (max. 3% of bank)</div><div class="green">• predictable growth</div>',
q:'A tangly bramble coated in a sticky, sweet substance. Unknown genetic ancestry. Children often pick these from fields as-is as a snack.',
onHarvest:function(x,y,age)
{
if (age>=this.mature)
{
var moni=Math.min(Game.cookies*0.03,Game.cookiesPs*60*3);
if (moni!=0)
{
Game.Earn(moni);
Game.Popup('(Chocoroot)<br>+'+Beautify(moni)+' cookies!',Game.mouseX,Game.mouseY);
}
}
},
},
'whiteChocoroot':{
name:'White chocoroot',
icon:10,
cost:15,
costM:100000,
ageTick:4,
ageTickR:0,
mature:25,
detailsStr:'Predictable growth',
children:['whiskerbloom','tidygrass'],
effsStr:'<div class="green">• +1% golden cookie gains</div><div class="green">• harvest when mature for +3 minutes of CpS (max. 3% of bank)</div><div class="green">• predictable growth</div>',
q:'A pale, even sweeter variant of the chocoroot. Often impedes travelers with its twisty branches.',
onHarvest:function(x,y,age)
{
if (age>=this.mature)
{
var moni=Math.min(Game.cookies*0.03,Game.cookiesPs*60*3);
if (moni!=0)
{
Game.Earn(moni);
Game.Popup('(White chocoroot)<br>+'+Beautify(moni)+' cookies!',Game.mouseX,Game.mouseY);
}
}
},
},
'whiteMildew':{
name:'White mildew',
fungus:true,
icon:26,
cost:20,
costM:9999,
ageTick:8,
ageTickR:12,
mature:70,
detailsStr:'Spreads easily',
children:['brownMold','whiteChocoroot','wardlichen','greenRot'],
effsStr:'<div class="green">• +1% CpS</div><div class="gray">• may spread as brown mold</div>',
q:'A common rot that infests shady plots of earth. Grows in little creamy capsules. Smells sweet, but sadly wilts quickly.',
},
'brownMold':{
name:'Brown mold',
fungus:true,
icon:27,
cost:20,
costM:9999,
ageTick:8,
ageTickR:12,
mature:70,
detailsStr:'Spreads easily',
children:['whiteMildew','chocoroot','keenmoss','wrinklegill'],
effsStr:'<div class="red">• -1% CpS</div><div class="gray">• may spread as white mildew</div>',
q:'A common rot that infests shady plots of earth. Grows in odd reddish clumps. Smells bitter, but thankfully wilts quickly.',
},
'meddleweed':{
name:'Meddleweed',
weed:true,
icon:29,
cost:1,
costM:10,
ageTick:10,
ageTickR:6,
mature:50,
contam:0.05,
detailsStr:'Grows in empty tiles, spreads easily',
children:['meddleweed','brownMold','crumbspore'],
effsStr:'<div class="red">• useless</div><div class="red">• may overtake nearby plants</div><div class="gray">• may sometimes drop spores when uprooted</div>',
q:'The sign of a neglected farmland, this annoying weed spawns from unused dirt and may sometimes spread to other plants, killing them in the process.',
onKill:function(x,y,age)
{
if (Math.random()<0.2*(age/100)) M.plot[y][x]=[M.plants[choose(['brownMold','crumbspore'])].id+1,0];
},
},
'whiskerbloom':{
name:'Whiskerbloom',
icon:11,
cost:20,
costM:1000000,
ageTick:2,
ageTickR:2,
mature:60,
children:['chimerose','nursetulip'],
effsStr:'<div class="green">• +0.2% effects from milk</div>',
q:'Squeezing the translucent pods makes them excrete a milky liquid, while producing a faint squeak akin to a cat\'s meow.',
},
'chimerose':{
name:'Chimerose',
icon:12,
cost:15,
costM:242424,
ageTick:1,
ageTickR:1.5,
mature:30,
children:['chimerose'],
effsStr:'<div class="green">• +1% reindeer gains</div><div class="green">• +1% reindeer frequency</div>',
q:'Originating in the greener flanks of polar mountains, this beautiful flower with golden accents is fragrant enough to make any room feel a little bit more festive.',
},
'nursetulip':{
name:'Nursetulip',
icon:13,
cost:40,
costM:1000000000,
ageTick:0.5,
ageTickR:2,
mature:60,
children:[],
effsStr:'<div class="green">• surrounding plants (3x3) are 20% more efficient</div><div class="red">• -2% CpS</div>',
q:'This flower grows an intricate root network that distributes nutrients throughout the surrounding soil. The reason for this seemingly altruistic behavior is still unknown.',
},
'drowsyfern':{
name:'Drowsyfern',
icon:14,
cost:90,
costM:100000,
ageTick:0.05,
ageTickR:0.1,
mature:30,
children:[],
effsStr:'<div class="green">• +3% CpS</div><div class="red">• -5% cookies per click</div><div class="red">• -10% golden cookie frequency</div>',
q:'Traditionally used to brew a tea that guarantees a good night of sleep.',
onHarvest:function(x,y,age)
{
if (age>=this.mature) M.dropUpgrade('Fern tea',0.01);
},
},
'wardlichen':{
name:'Wardlichen',
icon:15,
cost:10,
costM:10000,
ageTick:5,
ageTickR:4,
mature:65,
children:['wardlichen'],
effsStr:'<div class="gray">• 2% less wrath cookies</div><div class="gray">• wrinklers spawn 15% slower</div>',
q:'The metallic stench that emanates from this organism has been known to keep insects and slugs away.',
},
'keenmoss':{
name:'Keenmoss',
icon:16,
cost:50,
costM:1000000,
ageTick:4,
ageTickR:5,
mature:65,
children:['drowsyfern','wardlichen','keenmoss'],
effsStr:'<div class="green">• +3% random drops</div>',
q:'Fuzzy to the touch and of a vibrant green. In plant symbolism, keenmoss is associated with good luck for finding lost objects.',
},
'queenbeet':{
name:'Queenbeet',
icon:17,
cost:60*1.5,
costM:1000000000,
ageTick:1,
ageTickR:0.4,
mature:80,
noContam:true,
children:['duketater','queenbeetLump','shriekbulb'],
effsStr:'<div class="green">• +0.3% golden cookie effect duration</div><div class="red">• -2% CpS</div><div class="green">• harvest when mature for +1 hour of CpS (max. 4% of bank)</div>',
q:'A delicious taproot used to prepare high-grade white sugar. Entire countries once went to war over these.',
onHarvest:function(x,y,age)
{
if (age>=this.mature)
{
var moni=Math.min(Game.cookies*0.04,Game.cookiesPs*60*60);
if (moni!=0)
{
Game.Earn(moni);
Game.Popup('(Queenbeet)<br>+'+Beautify(moni)+' cookies!',Game.mouseX,Game.mouseY);
}
}
},
},
'queenbeetLump':{
name:'Juicy queenbeet',
icon:18,
plantable:false,
cost:60*2,
costM:1000000000000,
ageTick:0.04,
ageTickR:0.08,
mature:85,
noContam:true,
children:[],
effsStr:'<div class="red">• -10% CpS</div><div class="red">• surrounding plants (3x3) are 20% less efficient</div><div class="green">• harvest when mature for a sugar lump</div>',
q:'A delicious taproot used to prepare high-grade white sugar. Entire countries once went to war over these.<br>It looks like this one has grown especially sweeter and juicier from growing in close proximity to other queenbeets.',
onHarvest:function(x,y,age)
{
if (age>=this.mature)
{
Game.gainLumps(1);
popup='(Juicy queenbeet)<br>Sweet!<div style="font-size:65%;">Found 1 sugar lump!</div>';
}
},
},
'duketater':{
name:'Duketater',
icon:19,
cost:60*8,
costM:1000000000000,
ageTick:0.4,
ageTickR:0.1,
mature:95,
noContam:true,
children:['shriekbulb'],
effsStr:'<div class="green">• harvest when mature for +2 hours of CpS (max. 8% of bank)</div>',
q:'A rare, rich-tasting tuber fit for a whole meal, as long as its strict harvesting schedule is respected. Its starch has fascinating baking properties.',
onHarvest:function(x,y,age)
{
if (age>=this.mature)
{
var moni=Math.min(Game.cookies*0.08,Game.cookiesPs*60*60*2);
if (moni!=0)
{
Game.Earn(moni);
Game.Popup('(Duketater)<br>+'+Beautify(moni)+' cookies!',Game.mouseX,Game.mouseY);
}
M.dropUpgrade('Duketater cookies',0.005);
}
},
},
'crumbspore':{
name:'Crumbspore',
fungus:true,
icon:20,
cost:10,
costM:999,
ageTick:3,
ageTickR:3,
mature:65,
contam:0.03,
noContam:true,
detailsStr:'Spreads easily',
children:['crumbspore','glovemorel','cheapcap','doughshroom','wrinklegill','ichorpuff'],
effsStr:'<div class="green">• explodes into up to 1 minute of CpS at the end of its lifecycle (max. 1% of bank)</div><div class="red">• may overtake nearby plants</div>',
q:'An archaic mold that spreads its spores to the surrounding dirt through simple pod explosion.',
onDie:function(x,y)
{
var moni=Math.min(Game.cookies*0.01,Game.cookiesPs*60)*Math.random();
if (moni!=0)
{
Game.Earn(moni);
Game.Popup('(Crumbspore)<br>+'+Beautify(moni)+' cookies!',Game.mouseX,Game.mouseY);
}
},
},
'doughshroom':{
name:'Doughshroom',
fungus:true,
icon:24,
cost:100,
costM:100000000,
ageTick:1,
ageTickR:2,
mature:85,
contam:0.03,
noContam:true,
detailsStr:'Spreads easily',
children:['crumbspore','doughshroom','foolBolete','shriekbulb'],
effsStr:'<div class="green">• explodes into up to 5 minutes of CpS at the end of its lifecycle (max. 3% of bank)</div><div class="red">• may overtake nearby plants</div>',
q:'Jammed full of warm spores; some forest walkers often describe the smell as similar to passing by a bakery.',
onDie:function(x,y)
{
var moni=Math.min(Game.cookies*0.03,Game.cookiesPs*60*5)*Math.random();
if (moni!=0)
{
Game.Earn(moni);
Game.Popup('(Doughshroom)<br>+'+Beautify(moni)+' cookies!',Game.mouseX,Game.mouseY);
}
},
},
'glovemorel':{
name:'Glovemorel',
fungus:true,
icon:21,
cost:30,
costM:10000,
ageTick:3,
ageTickR:18,
mature:80,
children:[],
effsStr:'<div class="green">• +4% cookies per click</div><div class="green">• +1% cursor CpS</div><div class="red">• -1% CpS</div>',
q:'Touching its waxy skin reveals that the interior is hollow and uncomfortably squishy.',
},
'cheapcap':{
name:'Cheapcap',
fungus:true,
icon:22,
cost:40,
costM:100000,
ageTick:6,
ageTickR:16,
mature:40,
children:[],
effsStr:'<div class="green">• buildings and upgrades are 0.2% cheaper</div><div class="red">• cannot handle cold climates; 15% chance to die when frozen</div>',
q:'Small, tough, and good in omelettes. Some historians propose that the heads of dried cheapcaps were once used as currency in some bronze age societies.',
},
'foolBolete':{
name:'Fool\'s bolete',
fungus:true,
icon:23,
cost:15,
costM:10000,
ageTick:5,
ageTickR:25,
mature:50,
children:[],
effsStr:'<div class="green">• +2% golden cookie frequency</div><div class="red">• -5% golden cookie gains</div><div class="red">• -2% golden cookie duration</div><div class="red">• -2% golden cookie effect duration</div>',
q:'Named for its ability to fool mushroom pickers. The fool\'s bolete is not actually poisonous, it\'s just extremely bland.',
},
'wrinklegill':{
name:'Wrinklegill',
fungus:true,
icon:25,
cost:20,
costM:1000000,
ageTick:1,
ageTickR:3,
mature:65,
children:['elderwort','shriekbulb'],
effsStr:'<div class="gray">• wrinklers spawn 2% faster</div><div class="gray">• wrinklers eat 1% more</div>',
q:'This mushroom\'s odor resembles that of a well-done steak, and is said to whet the appetite - making one\'s stomach start gurgling within seconds.',
},
'greenRot':{
name:'Green rot',
fungus:true,
icon:28,
cost:60,
costM:1000000,
ageTick:12,
ageTickR:13,
mature:65,
children:['keenmoss','foolBolete'],
effsStr:'<div class="green">• +0.5% golden cookie duration</div><div class="green">• +1% golden cookie frequency</div><div class="green">• +1% random drops</div>',
q:'This short-lived mold is also known as "emerald pebbles", and is considered by some as a pseudo-gem that symbolizes good fortune.',
onHarvest:function(x,y,age)
{
if (age>=this.mature) M.dropUpgrade('Green yeast digestives',0.005);
},
},
'shriekbulb':{
name:'Shriekbulb',
icon:30,
cost:60,
costM:4444444444444,
ageTick:3,
ageTickR:1,
mature:60,
noContam:true,
detailsStr:'The unfortunate result of some plant combinations',
children:['shriekbulb'],
effsStr:'<div class="red">• -2% CpS</div><div class="red">• surrounding plants (3x3) are 5% less efficient</div>',
q:'A nasty vegetable with a dreadful quirk : its flesh resonates with a high-pitched howl whenever it is hit at the right angle by sunlight, moonlight, or even a slight breeze.',
},
'tidygrass':{
name:'Tidygrass',
icon:31,
cost:90,
costM:100000000000000,
ageTick:0.5,
ageTickR:0,
mature:40,
children:['everdaisy'],
effsStr:'<div class="green">• surrounding tiles (5x5) develop no weeds or fungus</div>',
q:'The molecules this grass emits are a natural weedkiller. Its stems grow following a predictable pattern, making it an interesting -if expensive- choice for a lawn grass.',
},
'everdaisy':{
name:'Everdaisy',
icon:32,
cost:180,
costM:100000000000000000000,
ageTick:0.3,
ageTickR:0,
mature:75,
noContam:true,
immortal:1,
detailsStr:'Immortal',
children:[],
effsStr:'<div class="green">• surrounding tiles (3x3) develop no weeds or fungus</div><div class="green">• immortal</div>',
q:'While promoted by some as a superfood owing to its association with longevity and intriguing geometry, this elusive flower is actually mildly toxic.',
},
'ichorpuff':{
name:'Ichorpuff',
fungus:true,
icon:33,
cost:120,
costM:987654321,
ageTick:1,
ageTickR:1.5,
mature:35,
children:[],
effsStr:'<div class="green">• surrounding plants (3x3) age half as fast</div><div class="red">• surrounding plants (3x3) are half as efficient</div>',
q:'This puffball mushroom contains sugary spores, but it never seems to mature to bursting on its own. Surrounding plants under its influence have a very slow metabolism, reducing their effects but lengthening their lifespan.',
onHarvest:function(x,y,age)
{
if (age>=this.mature) M.dropUpgrade('Ichor syrup',0.005);
},
},
};
M.plantsById=[];var n=0;
for (var i in M.plants)
{
M.plants[i].unlocked=0;
M.plants[i].id=n;
M.plants[i].key=i;
M.plants[i].matureBase=M.plants[i].mature;
M.plantsById[n]=M.plants[i];
if (typeof M.plants[i].plantable==='undefined') {M.plants[i].plantable=true;}
n++;
}
M.plantsN=M.plantsById.length;
M.plantsUnlockedN=0;
M.getUnlockedN=function()
{
M.plantsUnlockedN=0;
for (var i in M.plants){if (M.plants[i].unlocked) M.plantsUnlockedN++;}
if (M.plantsUnlockedN>=M.plantsN)
{
Game.Win('Keeper of the conservatory');
l('gardenTool-3').classList.remove('locked');
}
else l('gardenTool-3').classList.add('locked');
return M.plantsUnlockedN;
}
M.dropUpgrade=function(upgrade,rate)
{
if (!Game.Has(upgrade) && Math.random()<=rate*Game.dropRateMult()*(Game.HasAchiev('Seedless to nay')?1.05:1))
{
Game.Unlock(upgrade);
}
}
M.computeMatures=function()
{
var mult=1;
if (Game.HasAchiev('Seedless to nay')) mult=0.95;
for (var i in M.plants)
{
M.plants[i].mature=M.plants[i].matureBase*mult;
}
}
M.plantContam={};
for (var i in M.plants)
{
if (M.plants[i].contam) M.plantContam[M.plants[i].key]=M.plants[i].contam;
}
M.getMuts=function(neighs,neighsM)
{
//get possible mutations given a list of neighbors
//note : neighs stands for neighbors, not horsey noises
var muts=[];
if (neighsM['bakerWheat']>=2) muts.push(['bakerWheat',0.2],['thumbcorn',0.05],['bakeberry',0.001]);
if (neighsM['bakerWheat']>=1 && neighsM['thumbcorn']>=1) muts.push(['cronerice',0.01]);
if (neighsM['thumbcorn']>=2) muts.push(['thumbcorn',0.1],['bakerWheat',0.05]);
if (neighsM['cronerice']>=1 && neighsM['thumbcorn']>=1) muts.push(['gildmillet',0.03]);
if (neighsM['cronerice']>=2) muts.push(['thumbcorn',0.02]);
if (neighsM['bakerWheat']>=1 && neighsM['gildmillet']>=1) muts.push(['clover',0.03],['goldenClover',0.0007]);
if (neighsM['clover']>=1 && neighsM['gildmillet']>=1) muts.push(['shimmerlily',0.02]);
if (neighsM['clover']>=2 && neighs['clover']<5) muts.push(['clover',0.007],['goldenClover',0.0001]);
if (neighsM['clover']>=4) muts.push(['goldenClover',0.0007]);
if (neighsM['shimmerlily']>=1 && neighsM['cronerice']>=1) muts.push(['elderwort',0.01]);
if (neighsM['wrinklegill']>=1 && neighsM['cronerice']>=1) muts.push(['elderwort',0.002]);
if (neighsM['bakerWheat']>=1 && neighs['brownMold']>=1) muts.push(['chocoroot',0.1]);
if (neighsM['chocoroot']>=1 && neighs['whiteMildew']>=1) muts.push(['whiteChocoroot',0.1]);
if (neighsM['whiteMildew']>=1 && neighs['brownMold']<=1) muts.push(['brownMold',0.5]);
if (neighsM['brownMold']>=1 && neighs['whiteMildew']<=1) muts.push(['whiteMildew',0.5]);
if (neighsM['meddleweed']>=1 && neighs['meddleweed']<=3) muts.push(['meddleweed',0.15]);
if (neighsM['shimmerlily']>=1 && neighsM['whiteChocoroot']>=1) muts.push(['whiskerbloom',0.01]);
if (neighsM['shimmerlily']>=1 && neighsM['whiskerbloom']>=1) muts.push(['chimerose',0.05]);
if (neighsM['chimerose']>=2) muts.push(['chimerose',0.005]);
if (neighsM['whiskerbloom']>=2) muts.push(['nursetulip',0.05]);
if (neighsM['chocoroot']>=1 && neighsM['keenmoss']>=1) muts.push(['drowsyfern',0.005]);
if ((neighsM['cronerice']>=1 && neighsM['keenmoss']>=1) || (neighsM['cronerice']>=1 && neighsM['whiteMildew']>=1)) muts.push(['wardlichen',0.005]);
if (neighsM['wardlichen']>=1 && neighs['wardlichen']<2) muts.push(['wardlichen',0.05]);
if (neighsM['greenRot']>=1 && neighsM['brownMold']>=1) muts.push(['keenmoss',0.1]);
if (neighsM['keenmoss']>=1 && neighs['keenmoss']<2) muts.push(['keenmoss',0.05]);
if (neighsM['chocoroot']>=1 && neighsM['bakeberry']>=1) muts.push(['queenbeet',0.01]);
if (neighsM['queenbeet']>=8) muts.push(['queenbeetLump',0.001]);
if (neighsM['queenbeet']>=2) muts.push(['duketater',0.001]);
if (neighsM['crumbspore']>=1 && neighs['crumbspore']<=1) muts.push(['crumbspore',0.07]);
if (neighsM['crumbspore']>=1 && neighsM['thumbcorn']>=1) muts.push(['glovemorel',0.02]);
if (neighsM['crumbspore']>=1 && neighsM['shimmerlily']>=1) muts.push(['cheapcap',0.04]);
if (neighsM['doughshroom']>=1 && neighsM['greenRot']>=1) muts.push(['foolBolete',0.04]);
if (neighsM['crumbspore']>=2) muts.push(['doughshroom',0.005]);
if (neighsM['doughshroom']>=1 && neighs['doughshroom']<=1) muts.push(['doughshroom',0.07]);
if (neighsM['doughshroom']>=2) muts.push(['crumbspore',0.005]);
if (neighsM['crumbspore']>=1 && neighsM['brownMold']>=1) muts.push(['wrinklegill',0.06]);
if (neighsM['whiteMildew']>=1 && neighsM['clover']>=1) muts.push(['greenRot',0.05]);
if (neighsM['wrinklegill']>=1 && neighsM['elderwort']>=1) muts.push(['shriekbulb',0.001]);
if (neighsM['elderwort']>=5) muts.push(['shriekbulb',0.001]);
if (neighs['duketater']>=3) muts.push(['shriekbulb',0.005]);
if (neighs['doughshroom']>=4) muts.push(['shriekbulb',0.002]);
if (neighsM['queenbeet']>=5) muts.push(['shriekbulb',0.001]);
if (neighs['shriekbulb']>=1 && neighs['shriekbulb']<2) muts.push(['shriekbulb',0.005]);
if (neighsM['bakerWheat']>=1 && neighsM['whiteChocoroot']>=1) muts.push(['tidygrass',0.002]);
if (neighsM['tidygrass']>=3 && neighsM['elderwort']>=3) muts.push(['everdaisy',0.002]);
if (neighsM['elderwort']>=1 && neighsM['crumbspore']>=1) muts.push(['ichorpuff',0.002]);
return muts;
}
M.computeBoostPlot=function()
{
//some plants apply effects to surrounding tiles
//this function computes those effects by creating a grid in which those effects stack
for (var y=0;y<6;y++)
{
for (var x=0;x<6;x++)
{
//age mult, power mult, weed mult
M.plotBoost[y][x]=[1,1,1];
}
}
var effectOn=function(X,Y,s,mult)
{
for (var y=Math.max(0,Y-s);y<Math.min(6,Y+s+1);y++)
{
for (var x=Math.max(0,X-s);x<Math.min(6,X+s+1);x++)
{
if (X==x && Y==y) {}
else
{
for (var i=0;i<mult.length;i++)
{
M.plotBoost[y][x][i]*=mult[i];
}
}
}
}
}
for (var y=0;y<6;y++)
{
for (var x=0;x<6;x++)
{
var tile=M.plot[y][x];
if (tile[0]>0)
{
var me=M.plantsById[tile[0]-1];
var name=me.key;
var stage=0;
if (tile[1]>=me.mature) stage=4;
else if (tile[1]>=me.mature*0.666) stage=3;
else if (tile[1]>=me.mature*0.333) stage=2;
else stage=1;
var soilMult=M.soilsById[M.soil].effMult;
var mult=soilMult;
if (stage==1) mult*=0.1;
else if (stage==2) mult*=0.25;
else if (stage==3) mult*=0.5;
else mult*=1;
//age mult, power mult, weed mult
/*if (name=='elderwort') effectOn(x,y,1,[1+0.03*mult,1,1]);
else if (name=='queenbeetLump') effectOn(x,y,1,[1,1-0.2*mult,1]);
else if (name=='nursetulip') effectOn(x,y,1,[1,1+0.2*mult,1]);
else if (name=='shriekbulb') effectOn(x,y,1,[1,1-0.05*mult,1]);
else if (name=='tidygrass') effectOn(x,y,2,[1,1,0]);
else if (name=='everdaisy') effectOn(x,y,1,[1,1,0]);
else if (name=='ichorpuff') effectOn(x,y,1,[1-0.5*mult,1-0.5*mult,1]);*/
var ageMult=1;
var powerMult=1;
var weedMult=1;
var range=0;
if (name=='elderwort') {ageMult=1.03;range=1;}
else if (name=='queenbeetLump') {powerMult=0.8;range=1;}
else if (name=='nursetulip') {powerMult=1.2;range=1;}
else if (name=='shriekbulb') {powerMult=0.95;range=1;}
else if (name=='tidygrass') {weedMult=0;range=2;}
else if (name=='everdaisy') {weedMult=0;range=1;}
else if (name=='ichorpuff') {ageMult=0.5;powerMult=0.5;range=1;}
//by god i hope these are right
if (ageMult>=1) ageMult=(ageMult-1)*mult+1; else if (mult>=1) ageMult=1/((1/ageMult)*mult); else ageMult=1-(1-ageMult)*mult;
if (powerMult>=1) powerMult=(powerMult-1)*mult+1; else if (mult>=1) powerMult=1/((1/powerMult)*mult); else powerMult=1-(1-powerMult)*mult;
if (range>0) effectOn(x,y,range,[ageMult,powerMult,weedMult]);
}
}
}
}
M.computeEffs=function()
{
M.toCompute=false;
var effs={
cps:1,
click:1,
cursorCps:1,
grandmaCps:1,
goldenCookieGain:1,
goldenCookieFreq:1,
goldenCookieDur:1,
goldenCookieEffDur:1,
wrathCookieGain:1,
wrathCookieFreq:1,
wrathCookieDur:1,
wrathCookieEffDur:1,
reindeerGain:1,
reindeerFreq:1,
reindeerDur:1,
itemDrops:1,
milk:1,
wrinklerSpawn:1,
wrinklerEat:1,
upgradeCost:1,
buildingCost:1,
};
if (!M.freeze)
{
var soilMult=M.soilsById[M.soil].effMult;
for (var y=0;y<6;y++)
{
for (var x=0;x<6;x++)
{
var tile=M.plot[y][x];
if (tile[0]>0)
{
var me=M.plantsById[tile[0]-1];
var name=me.key;
var stage=0;
if (tile[1]>=me.mature) stage=4;
else if (tile[1]>=me.mature*0.666) stage=3;
else if (tile[1]>=me.mature*0.333) stage=2;
else stage=1;
var mult=soilMult;
if (stage==1) mult*=0.1;
else if (stage==2) mult*=0.25;
else if (stage==3) mult*=0.5;
else mult*=1;
mult*=M.plotBoost[y][x][1];
if (name=='bakerWheat') effs.cps+=0.01*mult;
else if (name=='thumbcorn') effs.click+=0.02*mult;
else if (name=='cronerice') effs.grandmaCps+=0.03*mult;
else if (name=='gildmillet') {effs.goldenCookieGain+=0.01*mult;effs.goldenCookieEffDur+=0.001*mult;}
else if (name=='clover') effs.goldenCookieFreq+=0.01*mult;
else if (name=='goldenClover') effs.goldenCookieFreq+=0.03*mult;
else if (name=='shimmerlily') {effs.goldenCookieGain+=0.01*mult;effs.goldenCookieFreq+=0.01*mult;effs.itemDrops+=0.01*mult;}
else if (name=='elderwort') {effs.wrathCookieGain+=0.01*mult;effs.wrathCookieFreq+=0.01*mult;effs.grandmaCps+=0.01*mult;}
else if (name=='bakeberry') effs.cps+=0.01*mult;
else if (name=='chocoroot') effs.cps+=0.01*mult;
else if (name=='whiteChocoroot') effs.goldenCookieGain+=0.01*mult;
else if (name=='whiteMildew') effs.cps+=0.01*mult;
else if (name=='brownMold') effs.cps*=1-0.01*mult;
else if (name=='meddleweed') {}
else if (name=='whiskerbloom') effs.milk+=0.002*mult;
else if (name=='chimerose') {effs.reindeerGain+=0.01*mult;effs.reindeerFreq+=0.01*mult;}
else if (name=='nursetulip') {effs.cps*=1-0.02*mult;}
else if (name=='drowsyfern') {effs.cps+=0.03*mult;effs.click*=1-0.05*mult;effs.goldenCookieFreq*=1-0.1*mult;}
else if (name=='wardlichen') {effs.wrinklerSpawn*=1-0.15*mult;effs.wrathCookieFreq*=1-0.02*mult;}
else if (name=='keenmoss') {effs.itemDrops+=0.03*mult;}
else if (name=='queenbeet') {effs.goldenCookieEffDur+=0.003*mult;effs.cps*=1-0.02*mult;}
else if (name=='queenbeetLump') {effs.cps*=1-0.1*mult;}
else if (name=='glovemorel') {effs.click+=0.04*mult;effs.cursorCps+=0.01*mult;effs.cps*=1-0.01*mult;}
else if (name=='cheapcap') {effs.upgradeCost*=1-0.002*mult;effs.buildingCost*=1-0.002*mult;}
else if (name=='foolBolete') {effs.goldenCookieFreq+=0.02*mult;effs.goldenCookieGain*=1-0.05*mult;effs.goldenCookieDur*=1-0.02*mult;effs.goldenCookieEffDur*=1-0.02*mult;}
else if (name=='wrinklegill') {effs.wrinklerSpawn+=0.02*mult;effs.wrinklerEat+=0.01*mult;}
else if (name=='greenRot') {effs.goldenCookieDur+=0.005*mult;effs.goldenCookieFreq+=0.01*mult;effs.itemDrops+=0.01*mult;}
else if (name=='shriekbulb') {effs.cps*=1-0.02*mult;}
}
}
}
}
M.effs=effs;
Game.recalculateGains=1;
}
M.soils={
'dirt':{
name:'Dirt',
icon:0,
tick:5,
effMult:1,
weedMult:1,
req:0,
effsStr:'<div class="gray">• tick every <b>5 minutes</b></div>',
q:'Simple, regular old dirt that you\'d find in nature.',
},
'fertilizer':{
name:'Fertilizer',
icon:1,
tick:3,
effMult:0.75,
weedMult:1.2,
req:50,
effsStr:'<div class="gray">• tick every <b>3 minutes</b></div><div class="red">• passive plant effects <b>-25%</b></div><div class="red">• weeds appear <b>20%</b> more</div>',
q:'Soil with a healthy helping of fresh manure. Plants grow faster but are less efficient.',
},
'clay':{
name:'Clay',
icon:2,
tick:15,
effMult:1.25,
weedMult:1,
req:100,
effsStr:'<div class="gray">• tick every <b>15 minutes</b></div><div class="green">• passive plant effects <b>+25%</b></div>',
q:'Rich soil with very good water retention. Plants grow slower but are more efficient.',
},
'pebbles':{
name:'Pebbles',
icon:3,
tick:5,
effMult:0.25,
weedMult:0.1,
req:200,
effsStr:'<div class="gray">• tick every <b>5 minutes</b></div><div class="red">• passive plant effects <b>-75%</b></div><div class="green">• <b>35% chance</b> of collecting seeds automatically when plants expire</div><div class="green">• weeds appear <b>10 times</b> less</div>',
q:'Dry soil made of small rocks tightly packed together. Not very conductive to plant health, but whatever falls off your crops will be easy to retrieve.<br>Useful if you\'re one of those farmers who just want to find new seeds without having to tend their garden too much.',
},
'woodchips':{
name:'Wood chips',
icon:4,
tick:5,
effMult:0.25,
weedMult:0.1,
req:300,
effsStr:'<div class="gray">• tick every <b>5 minutes</b></div><div class="red">• passive plant effects <b>-75%</b></div><div class="green">• plants spread and mutate <b>3 times more</b></div><div class="green">• weeds appear <b>10 times</b> less</div>',
q:'Soil made of bits and pieces of bark and sawdust. Helpful for young sprouts to develop, not so much for mature plants.',
},
};
M.soilsById=[];var n=0;for (var i in M.soils){M.soils[i].id=n;M.soils[i].key=i;M.soilsById[n]=M.soils[i];n++;}
M.tools={
'info':{
name:'Garden information',
icon:3,
desc:'-',
descFunc:function()
{
var str='';
if (M.freeze) str='Your garden is frozen, providing no effects.';
else
{
var effs={
cps:{n:'CpS'},
click:{n:'cookies/click'},
cursorCps:{n:'cursor CpS'},
grandmaCps:{n:'grandma CpS'},
goldenCookieGain:{n:'golden cookie gains'},
goldenCookieFreq:{n:'golden cookie frequency'},
goldenCookieDur:{n:'golden cookie duration'},
goldenCookieEffDur:{n:'golden cookie effect duration'},
wrathCookieGain:{n:'wrath cookie gains'},
wrathCookieFreq:{n:'wrath cookie frequency'},
wrathCookieDur:{n:'wrath cookie duration'},
wrathCookieEffDur:{n:'wrath cookie effect duration'},
reindeerGain:{n:'reindeer gains'},
reindeerFreq:{n:'reindeer cookie frequency'},
reindeerDur:{n:'reindeer cookie duration'},
itemDrops:{n:'random drops'},
milk:{n:'milk effects'},
wrinklerSpawn:{n:'wrinkler spawn rate'},
wrinklerEat:{n:'wrinkler appetite'},
upgradeCost:{n:'upgrade costs',rev:true},
buildingCost:{n:'building costs',rev:true},
};
var effStr='';
for (var i in M.effs)
{
if (M.effs[i]!=1 && effs[i])
{
var amount=(M.effs[i]-1)*100;
effStr+='<div style="font-size:10px;margin-left:64px;"><b>• '+effs[i].n+' :</b> <span class="'+((amount*(effs[i].rev?-1:1))>0?'green':'red')+'">'+(amount>0?'+':'-')+Beautify(Math.abs(M.effs[i]-1)*100,2)+'%</span></div>';
}
}
if (effStr=='') effStr='<div style="font-size:10px;margin-left:64px;"><b>None.</b></div>';
str+='<div>Combined effects of all your plants :</div>'+effStr;
}
str+='<div class="line"></div>';
str+='<img src="img/gardenTip.png" style="float:right;margin:0px 0px 8px 8px;"/><small style="line-height:100%;">• You can cross-breed plants by planting them close to each other; new plants will grow in the empty tiles next to them.<br>• Unlock new seeds by harvesting mature plants.<br>• When you ascend, your garden plants are reset, but you keep all the seeds you\'ve unlocked.<br>• Your garden has no effect and does not grow while the game is closed.</small>';
return str;
},
func:function(){},
},
'harvestAll':{
name:'Harvest all',
icon:0,
descFunc:function(){return 'Instantly harvest all plants in your garden.<div class="line"></div>'+((Game.keys[16] && Game.keys[17])?'<b>You are holding shift+ctrl.</b> Only mature, mortal plants will be harvested.':'Shift+ctrl+click to harvest only mature, mortal plants.');},
func:function(){
PlaySound('snd/toneTick.mp3');
/*if (M.freeze){return false;}*/
if (Game.keys[16] && Game.keys[17]) M.harvestAll(0,1,1);//ctrl & shift, harvest only mature non-immortal plants
else M.harvestAll();
},
},
'freeze':{
name:'Freeze',
icon:1,
descFunc:function()
{
return 'Cryogenically preserve your garden.<br>Plants no longer grow, spread or die; they provide no benefits.<br>Soil cannot be changed.<div class="line"></div>Using this will effectively pause your garden.<div class="line"></div>';//<span class="red">'+((M.nextFreeze>Date.now())?'You will be able to freeze your garden again in '+Game.sayTime((M.nextFreeze-Date.now())/1000*30+30,-1)+'.':'After unfreezing your garden, you must wait 10 minutes to freeze it again.')+'</span>
},
func:function(){