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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
|
#include "global.h"
#include "berry.h"
#include "asm.h"
#include "item.h"
#include "items.h"
#include "main.h"
#include "rng.h"
#include "text.h"
#include "field_control_avatar.h"
#define BERRY_NAME_LENGTH 6
#define FIRST_BERRY ITEM_CHERI_BERRY
#define LAST_BERRY ITEM_ENIGMA_BERRY
const u8 gBerryDescriptionPart1_Cheri[] = _("Blooms with delicate pretty flowers.");
const u8 gBerryDescriptionPart2_Cheri[] = _("The bright red BERRY is very spicy.");
const u8 gBerryDescriptionPart1_Chesto[] = _("The BERRY’s thick skin and fruit are");
const u8 gBerryDescriptionPart2_Chesto[] = _("very tough. It is dry-tasting all over.");
const u8 gBerryDescriptionPart1_Pecha[] = _("Very sweet and delicious.");
const u8 gBerryDescriptionPart2_Pecha[] = _("Also very tender - handle with care.");
const u8 gBerryDescriptionPart1_Rawst[] = _("If the leaves grow long and curly,");
const u8 gBerryDescriptionPart2_Rawst[] = _("the BERRY seems to grow very bitter.");
const u8 gBerryDescriptionPart1_Aspear[] = _("The hard BERRY is dense with a rich");
const u8 gBerryDescriptionPart2_Aspear[] = _("juice. It is quite sour.");
const u8 gBerryDescriptionPart1_Leppa[] = _("Grows slower than CHERI and others.");
const u8 gBerryDescriptionPart2_Leppa[] = _("The smaller the BERRY, the tastier.");
const u8 gBerryDescriptionPart1_Oran[] = _("A peculiar BERRY with a mix of flavors.");
const u8 gBerryDescriptionPart2_Oran[] = _("BERRIES grow in half a day.");
const u8 gBerryDescriptionPart1_Persim[] = _("Loves sunlight. The BERRY’s color");
const u8 gBerryDescriptionPart2_Persim[] = _("grows vivid when exposed to the sun.");
const u8 gBerryDescriptionPart1_Lum[] = _("Slow to grow. If raised with loving");
const u8 gBerryDescriptionPart2_Lum[] = _("care, it may grow two BERRIES.");
const u8 gBerryDescriptionPart1_Sitrus[] = _("Closely related to ORAN. The large");
const u8 gBerryDescriptionPart2_Sitrus[] = _("BERRY has a well-rounded flavor.");
const u8 gBerryDescriptionPart1_Figy[] = _("The BERRY, which looks chewed up,");
const u8 gBerryDescriptionPart2_Figy[] = _("brims with spicy substances.");
const u8 gBerryDescriptionPart1_Wiki[] = _("The BERRY is said to have grown lumpy");
const u8 gBerryDescriptionPart2_Wiki[] = _("to help POKéMON grip it.");
const u8 gBerryDescriptionPart1_Mago[] = _("The BERRY turns curvy as it grows.");
const u8 gBerryDescriptionPart2_Mago[] = _("The curvier, the sweeter and tastier.");
const u8 gBerryDescriptionPart1_Aguav[] = _("The flower is dainty. It is rare in its");
const u8 gBerryDescriptionPart2_Aguav[] = _("ability to grow without light.");
const u8 gBerryDescriptionPart1_Iapapa[] = _("The BERRY is very big and sour.");
const u8 gBerryDescriptionPart2_Iapapa[] = _("It takes at least a day to grow.");
const u8 gBerryDescriptionPart1_Razz[] = _("The red BERRY tastes slightly spicy.");
const u8 gBerryDescriptionPart2_Razz[] = _("It grows quickly in just four hours.");
const u8 gBerryDescriptionPart1_Bluk[] = _("The BERRY is blue on the outside, but");
const u8 gBerryDescriptionPart2_Bluk[] = _("it blackens the mouth when eaten.");
const u8 gBerryDescriptionPart1_Nanab[] = _("This BERRY was the seventh");
const u8 gBerryDescriptionPart2_Nanab[] = _("discovered in the world. It is sweet.");
const u8 gBerryDescriptionPart1_Wepear[] = _("The flower is small and white. It has a");
const u8 gBerryDescriptionPart2_Wepear[] = _("delicate balance of bitter and sour.");
const u8 gBerryDescriptionPart1_Pinap[] = _("Weak against wind and cold.");
const u8 gBerryDescriptionPart2_Pinap[] = _("The fruit is spicy and the skin, sour.");
const u8 gBerryDescriptionPart1_Pomeg[] = _("However much it is watered,");
const u8 gBerryDescriptionPart2_Pomeg[] = _("it only grows up to six BERRIES.");
const u8 gBerryDescriptionPart1_Kelpsy[] = _("A rare variety shaped like a root.");
const u8 gBerryDescriptionPart2_Kelpsy[] = _("Grows a very large flower.");
const u8 gBerryDescriptionPart1_Qualot[] = _("Loves water. Grows strong even in");
const u8 gBerryDescriptionPart2_Qualot[] = _("locations with constant rainfall.");
const u8 gBerryDescriptionPart1_Hondew[] = _("A BERRY that is very valuable and");
const u8 gBerryDescriptionPart2_Hondew[] = _("rarely seen. It is very delicious.");
const u8 gBerryDescriptionPart1_Grepa[] = _("Despite its tenderness and round");
const u8 gBerryDescriptionPart2_Grepa[] = _("shape, the BERRY is unimaginably sour.");
const u8 gBerryDescriptionPart1_Tamato[] = _("The BERRY is lip-bendingly spicy.");
const u8 gBerryDescriptionPart2_Tamato[] = _("It takes time to grow.");
const u8 gBerryDescriptionPart1_Cornn[] = _("A BERRY from an ancient era. May not");
const u8 gBerryDescriptionPart2_Cornn[] = _("grow unless planted in quantity.");
const u8 gBerryDescriptionPart1_Magost[] = _("A BERRY that is widely said to have");
const u8 gBerryDescriptionPart2_Magost[] = _("a finely balanced flavor.");
const u8 gBerryDescriptionPart1_Rabuta[] = _("A rare variety that is overgrown with");
const u8 gBerryDescriptionPart2_Rabuta[] = _("hair. It is quite bitter.");
const u8 gBerryDescriptionPart1_Nomel[] = _("Quite sour. Just one bite makes it");
const u8 gBerryDescriptionPart2_Nomel[] = _("impossible to taste for three days.");
const u8 gBerryDescriptionPart1_Spelon[] = _("The vividly red BERRY is very spicy.");
const u8 gBerryDescriptionPart2_Spelon[] = _("Its warts secrete a spicy substance.");
const u8 gBerryDescriptionPart1_Pamtre[] = _("Drifts on the sea from somewhere.");
const u8 gBerryDescriptionPart2_Pamtre[] = _("It is thought to grow elsewhere.");
const u8 gBerryDescriptionPart1_Watmel[] = _("A huge BERRY, with some over 20");
const u8 gBerryDescriptionPart2_Watmel[] = _("inches discovered. Exceedingly sweet.");
const u8 gBerryDescriptionPart1_Durin[] = _("Bitter to even look at. It is so");
const u8 gBerryDescriptionPart2_Durin[] = _("bitter, no one has ever eaten it as is.");
const u8 gBerryDescriptionPart1_Belue[] = _("It is glossy and looks delicious, but");
const u8 gBerryDescriptionPart2_Belue[] = _("it is awfully sour. Takes time to grow.");
const u8 gBerryDescriptionPart1_Liechi[] = _("A mysterious BERRY. It is rumored to");
const u8 gBerryDescriptionPart2_Liechi[] = _("contain the power of the sea.");
const u8 gBerryDescriptionPart1_Ganlon[] = _("A mysterious BERRY. It is rumored to");
const u8 gBerryDescriptionPart2_Ganlon[] = _("contain the power of the land.");
const u8 gBerryDescriptionPart1_Salac[] = _("A mysterious BERRY. It is rumored to");
const u8 gBerryDescriptionPart2_Salac[] = _("contain the power of the sky.");
const u8 gBerryDescriptionPart1_Petaya[] = _("A mysterious BERRY. It is rumored to");
const u8 gBerryDescriptionPart2_Petaya[] = _("contain the power of all living things.");
const u8 gBerryDescriptionPart1_Apicot[] = _("A very mystifying BERRY. No telling");
const u8 gBerryDescriptionPart2_Apicot[] = _("what may happen or how it can be used.");
const u8 gBerryDescriptionPart1_Lansat[] = _("Said to be a legendary BERRY.");
const u8 gBerryDescriptionPart2_Lansat[] = _("Holding it supposedly brings joy.");
const u8 gBerryDescriptionPart1_Starf[] = _("So strong, it was abandoned at the");
const u8 gBerryDescriptionPart2_Starf[] = _("world’s edge. Considered a mirage.");
const u8 gBerryDescriptionPart1_Enigma[] = _("A completely enigmatic BERRY.");
const u8 gBerryDescriptionPart2_Enigma[] = _("Appears to have the power of stars.");
const struct Berry gBerries[] =
{
{
.name = _("CHERI"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 20,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Cheri,
.description2 = gBerryDescriptionPart2_Cheri,
.stageDuration = 3,
.spicy = 10,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 25,
},
{
.name = _("CHESTO"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 80,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Chesto,
.description2 = gBerryDescriptionPart2_Chesto,
.stageDuration = 3,
.spicy = 0,
.dry = 10,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 25,
},
{
.name = _("PECHA"),
.firmness = BERRY_FIRMNESS_VERY_SOFT,
.size = 40,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Pecha,
.description2 = gBerryDescriptionPart2_Pecha,
.stageDuration = 3,
.spicy = 0,
.dry = 0,
.sweet = 10,
.bitter = 0,
.sour = 0,
.smoothness = 25,
},
{
.name = _("RAWST"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 32,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Rawst,
.description2 = gBerryDescriptionPart2_Rawst,
.stageDuration = 3,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 10,
.sour = 0,
.smoothness = 25,
},
{
.name = _("ASPEAR"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 50,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Aspear,
.description2 = gBerryDescriptionPart2_Aspear,
.stageDuration = 3,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 10,
.smoothness = 25,
},
{
.name = _("LEPPA"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 28,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Leppa,
.description2 = gBerryDescriptionPart2_Leppa,
.stageDuration = 4,
.spicy = 10,
.dry = 0,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
{
.name = _("ORAN"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 35,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Oran,
.description2 = gBerryDescriptionPart2_Oran,
.stageDuration = 3,
.spicy = 10,
.dry = 10,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
{
.name = _("PERSIM"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 47,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Persim,
.description2 = gBerryDescriptionPart2_Persim,
.stageDuration = 3,
.spicy = 10,
.dry = 10,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
{
.name = _("LUM"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 34,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Lum,
.description2 = gBerryDescriptionPart2_Lum,
.stageDuration = 12,
.spicy = 10,
.dry = 10,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
{
.name = _("SITRUS"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 95,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Sitrus,
.description2 = gBerryDescriptionPart2_Sitrus,
.stageDuration = 6,
.spicy = 10,
.dry = 10,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
{
.name = _("FIGY"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 100,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Figy,
.description2 = gBerryDescriptionPart2_Figy,
.stageDuration = 6,
.spicy = 10,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 25,
},
{
.name = _("WIKI"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 115,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Wiki,
.description2 = gBerryDescriptionPart2_Wiki,
.stageDuration = 6,
.spicy = 0,
.dry = 10,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 25,
},
{
.name = _("MAGO"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 126,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Mago,
.description2 = gBerryDescriptionPart2_Mago,
.stageDuration = 6,
.spicy = 0,
.dry = 0,
.sweet = 10,
.bitter = 0,
.sour = 0,
.smoothness = 25,
},
{
.name = _("AGUAV"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 64,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Aguav,
.description2 = gBerryDescriptionPart2_Aguav,
.stageDuration = 6,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 10,
.sour = 0,
.smoothness = 25,
},
{
.name = _("IAPAPA"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 223,
.maxYield = 3,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Iapapa,
.description2 = gBerryDescriptionPart2_Iapapa,
.stageDuration = 6,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 10,
.smoothness = 25,
},
{
.name = _("RAZZ"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 120,
.maxYield = 6,
.minYield = 3,
.description1 = gBerryDescriptionPart1_Razz,
.description2 = gBerryDescriptionPart2_Razz,
.stageDuration = 1,
.spicy = 10,
.dry = 10,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 20,
},
{
.name = _("BLUK"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 108,
.maxYield = 6,
.minYield = 3,
.description1 = gBerryDescriptionPart1_Bluk,
.description2 = gBerryDescriptionPart2_Bluk,
.stageDuration = 1,
.spicy = 0,
.dry = 10,
.sweet = 10,
.bitter = 0,
.sour = 0,
.smoothness = 20,
},
{
.name = _("NANAB"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 77,
.maxYield = 6,
.minYield = 3,
.description1 = gBerryDescriptionPart1_Nanab,
.description2 = gBerryDescriptionPart2_Nanab,
.stageDuration = 1,
.spicy = 0,
.dry = 0,
.sweet = 10,
.bitter = 10,
.sour = 0,
.smoothness = 20,
},
{
.name = _("WEPEAR"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 74,
.maxYield = 6,
.minYield = 3,
.description1 = gBerryDescriptionPart1_Wepear,
.description2 = gBerryDescriptionPart2_Wepear,
.stageDuration = 1,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
{
.name = _("PINAP"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 80,
.maxYield = 6,
.minYield = 3,
.description1 = gBerryDescriptionPart1_Pinap,
.description2 = gBerryDescriptionPart2_Pinap,
.stageDuration = 1,
.spicy = 10,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 10,
.smoothness = 20,
},
{
.name = _("POMEG"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 135,
.maxYield = 6,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Pomeg,
.description2 = gBerryDescriptionPart2_Pomeg,
.stageDuration = 3,
.spicy = 10,
.dry = 0,
.sweet = 10,
.bitter = 10,
.sour = 0,
.smoothness = 20,
},
{
.name = _("KELPSY"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 150,
.maxYield = 6,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Kelpsy,
.description2 = gBerryDescriptionPart2_Kelpsy,
.stageDuration = 3,
.spicy = 0,
.dry = 10,
.sweet = 0,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
{
.name = _("QUALOT"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 110,
.maxYield = 6,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Qualot,
.description2 = gBerryDescriptionPart2_Qualot,
.stageDuration = 3,
.spicy = 10,
.dry = 0,
.sweet = 10,
.bitter = 0,
.sour = 10,
.smoothness = 20,
},
{
.name = _("HONDEW"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 162,
.maxYield = 6,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Hondew,
.description2 = gBerryDescriptionPart2_Hondew,
.stageDuration = 3,
.spicy = 10,
.dry = 10,
.sweet = 0,
.bitter = 10,
.sour = 0,
.smoothness = 20,
},
{
.name = _("GREPA"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 149,
.maxYield = 6,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Grepa,
.description2 = gBerryDescriptionPart2_Grepa,
.stageDuration = 3,
.spicy = 0,
.dry = 10,
.sweet = 10,
.bitter = 0,
.sour = 10,
.smoothness = 20,
},
{
.name = _("TAMATO"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 200,
.maxYield = 4,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Tamato,
.description2 = gBerryDescriptionPart2_Tamato,
.stageDuration = 6,
.spicy = 20,
.dry = 10,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 30,
},
{
.name = _("CORNN"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 75,
.maxYield = 4,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Cornn,
.description2 = gBerryDescriptionPart2_Cornn,
.stageDuration = 6,
.spicy = 0,
.dry = 20,
.sweet = 10,
.bitter = 0,
.sour = 0,
.smoothness = 30,
},
{
.name = _("MAGOST"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 140,
.maxYield = 4,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Magost,
.description2 = gBerryDescriptionPart2_Magost,
.stageDuration = 6,
.spicy = 0,
.dry = 0,
.sweet = 20,
.bitter = 10,
.sour = 0,
.smoothness = 30,
},
{
.name = _("RABUTA"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 226,
.maxYield = 4,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Rabuta,
.description2 = gBerryDescriptionPart2_Rabuta,
.stageDuration = 6,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 20,
.sour = 10,
.smoothness = 30,
},
{
.name = _("NOMEL"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 285,
.maxYield = 4,
.minYield = 2,
.description1 = gBerryDescriptionPart1_Nomel,
.description2 = gBerryDescriptionPart2_Nomel,
.stageDuration = 6,
.spicy = 10,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 20,
.smoothness = 30,
},
{
.name = _("SPELON"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 133,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Spelon,
.description2 = gBerryDescriptionPart2_Spelon,
.stageDuration = 18,
.spicy = 40,
.dry = 10,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 70,
},
{
.name = _("PAMTRE"),
.firmness = BERRY_FIRMNESS_VERY_SOFT,
.size = 244,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Pamtre,
.description2 = gBerryDescriptionPart2_Pamtre,
.stageDuration = 18,
.spicy = 0,
.dry = 40,
.sweet = 10,
.bitter = 0,
.sour = 0,
.smoothness = 70,
},
{
.name = _("WATMEL"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 250,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Watmel,
.description2 = gBerryDescriptionPart2_Watmel,
.stageDuration = 18,
.spicy = 0,
.dry = 0,
.sweet = 40,
.bitter = 10,
.sour = 0,
.smoothness = 70,
},
{
.name = _("DURIN"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 280,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Durin,
.description2 = gBerryDescriptionPart2_Durin,
.stageDuration = 18,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 40,
.sour = 10,
.smoothness = 70,
},
{
.name = _("BELUE"),
.firmness = BERRY_FIRMNESS_VERY_SOFT,
.size = 300,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Belue,
.description2 = gBerryDescriptionPart2_Belue,
.stageDuration = 18,
.spicy = 10,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 40,
.smoothness = 70,
},
{
.name = _("LIECHI"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 111,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Liechi,
.description2 = gBerryDescriptionPart2_Liechi,
.stageDuration = 24,
.spicy = 40,
.dry = 0,
.sweet = 40,
.bitter = 0,
.sour = 10,
.smoothness = 80,
},
{
.name = _("GANLON"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 33,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Ganlon,
.description2 = gBerryDescriptionPart2_Ganlon,
.stageDuration = 24,
.spicy = 0,
.dry = 40,
.sweet = 0,
.bitter = 40,
.sour = 0,
.smoothness = 80,
},
{
.name = _("SALAC"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 95,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Salac,
.description2 = gBerryDescriptionPart2_Salac,
.stageDuration = 24,
.spicy = 0,
.dry = 0,
.sweet = 40,
.bitter = 0,
.sour = 40,
.smoothness = 80,
},
{
.name = _("PETAYA"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 237,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Petaya,
.description2 = gBerryDescriptionPart2_Petaya,
.stageDuration = 24,
.spicy = 40,
.dry = 0,
.sweet = 0,
.bitter = 40,
.sour = 0,
.smoothness = 80,
},
{
.name = _("APICOT"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 75,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Apicot,
.description2 = gBerryDescriptionPart2_Apicot,
.stageDuration = 24,
.spicy = 0,
.dry = 40,
.sweet = 0,
.bitter = 0,
.sour = 40,
.smoothness = 80,
},
{
.name = _("LANSAT"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 97,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Lansat,
.description2 = gBerryDescriptionPart2_Lansat,
.stageDuration = 24,
.spicy = 10,
.dry = 10,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 30,
},
{
.name = _("STARF"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 153,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Starf,
.description2 = gBerryDescriptionPart2_Starf,
.stageDuration = 24,
.spicy = 10,
.dry = 10,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 30,
},
{
.name = _("ENIGMA"),
.firmness = BERRY_FIRMNESS_UNKNOWN,
.size = 0,
.maxYield = 2,
.minYield = 1,
.description1 = gBerryDescriptionPart1_Enigma,
.description2 = gBerryDescriptionPart2_Enigma,
.stageDuration = 24,
.spicy = 40,
.dry = 40,
.sweet = 40,
.bitter = 40,
.sour = 40,
.smoothness = 40,
},
};
const struct BerryTree gBlankBerryTree = {0};
extern u8 BerryTreeScript;
extern u16 gScriptItemId;
extern u16 gScriptLastTalked;
extern u16 gSpecialVar_0x8004;
extern u16 gSpecialVar_0x8005;
extern u16 gSpecialVar_0x8006;
// unused
void ClearEnigmaBerries(void)
{
CpuFill16(0, &gSaveBlock1.enigmaBerry, sizeof(gSaveBlock1.enigmaBerry));
}
void SetEnigmaBerry(u8 *src)
{
u32 i;
u8 *dest = (u8*)&gSaveBlock1.enigmaBerry;
for (i = 0; i < sizeof(gSaveBlock1.enigmaBerry); i++)
dest[i] = src[i];
gSaveBlock1.enigmaBerry.berry.description1 = gSaveBlock1.enigmaBerry.description1;
gSaveBlock1.enigmaBerry.berry.description2 = gSaveBlock1.enigmaBerry.description2;
}
u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry)
{
const u8 *description1;
const u8 *description2;
u32 i;
u32 checksum;
u8 *dest;
description1 = gSaveBlock1.enigmaBerry.berry.description1;
description2 = gSaveBlock1.enigmaBerry.berry.description2;
gSaveBlock1.enigmaBerry.berry.description1 = 0;
gSaveBlock1.enigmaBerry.berry.description2 = 0;
dest = (u8*)enigmaBerry;
checksum = 0;
for (i = 0; i < ((u32)&gSaveBlock1.enigmaBerry.checksum - (u32)&gSaveBlock1.enigmaBerry); i++)
{
checksum += dest[i];
}
gSaveBlock1.enigmaBerry.berry.description1 = description1;
gSaveBlock1.enigmaBerry.berry.description2 = description2;
return checksum;
}
bool32 IsEnigmaBerryValid(void)
{
if (!gSaveBlock1.enigmaBerry.berry.stageDuration)
return FALSE;
if (!gSaveBlock1.enigmaBerry.berry.maxYield)
return FALSE;
if (GetEnigmaBerryChecksum(&gSaveBlock1.enigmaBerry) != gSaveBlock1.enigmaBerry.checksum)
return FALSE;
return TRUE;
}
const struct Berry *GetBerryInfo(u8 berry)
{
if (berry == 0x2B && IsEnigmaBerryValid())
return &gSaveBlock1.enigmaBerry.berry;
else
{
if (berry == 0 || berry > 0x2B)
berry = 1;
return &gBerries[berry - 1];
}
}
struct BerryTree *GetBerryTreeInfo(u8 id)
{
return &gSaveBlock1.berryTrees[id];
}
bool32 FieldObjectInteractionWaterBerryTree(void)
{
struct BerryTree *tree = GetBerryTreeInfo(FieldObjectGetBerryTreeId(gSelectedMapObject));
switch (tree->stage)
{
case 1:
tree->watered1 = TRUE;
break;
case 2:
tree->watered2 = TRUE;
break;
case 3:
tree->watered3 = TRUE;
break;
case 4:
tree->watered4 = TRUE;
break;
default:
return FALSE;
}
return TRUE;
}
bool8 IsPlayerFacingPlantedBerryTree(void)
{
if (GetFieldObjectScriptPointerForComparison() == &BerryTreeScript
&& GetStageByBerryTreeId(FieldObjectGetBerryTreeId(gSelectedMapObject)) == 0)
return TRUE;
else
return FALSE;
}
bool8 TryToWaterBerryTree(void)
{
if (GetFieldObjectScriptPointerForComparison() != &BerryTreeScript)
return FALSE;
else
return FieldObjectInteractionWaterBerryTree();
}
void ClearBerryTrees(void)
{
int i;
struct SaveBlock1 *saveBlock1 = &gSaveBlock1;
struct BerryTree berryTree = gBlankBerryTree;
for (i = 0; i < (u8)ARRAY_COUNT(saveBlock1->berryTrees); i++) // casting to u8 fixes a mismatched signed compare. what
saveBlock1->berryTrees[i] = berryTree;
}
bool32 BerryTreeGrow(struct BerryTree *tree)
{
if (tree->growthSparkle)
return FALSE;
switch (tree->stage)
{
case 0:
return FALSE;
case 4:
tree->berryYield = CalcBerryYield(tree);
case 1:
case 2:
case 3:
tree->stage++;
break;
case 5:
tree->watered1 = 0;
tree->watered2 = 0;
tree->watered3 = 0;
tree->watered4 = 0;
tree->berryYield = 0;
tree->stage = 2;
if (++tree->regrowthCount == 10)
*tree = gBlankBerryTree;
break;
}
return TRUE;
}
void BerryTreeTimeUpdate(int time)
{
int i;
struct BerryTree *tree;
for (i = 0; i < (u8)ARRAY_COUNT(gSaveBlock1.berryTrees); i++)
{
tree = &gSaveBlock1.berryTrees[i];
if (tree->berry && tree->stage && !tree->growthSparkle)
{
if (time >= GetStageDurationByBerryType(tree->berry) * 71)
{
*tree = gBlankBerryTree;
}
else
{
int time2 = time;
while (time2 != 0)
{
if (tree->secondsUntilNextStage > time2)
{
tree->secondsUntilNextStage -= time2;
break;
}
time2 -= tree->secondsUntilNextStage;
tree->secondsUntilNextStage = GetStageDurationByBerryType(tree->berry);
if (!BerryTreeGrow(tree))
break;
if (tree->stage == 5)
tree->secondsUntilNextStage *= 4;
}
}
}
}
}
void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 sparkle)
{
struct BerryTree *tree = GetBerryTreeInfo(id);
*tree = gBlankBerryTree;
tree->berry = berry;
tree->secondsUntilNextStage = GetStageDurationByBerryType(berry);
tree->stage = stage;
if (stage == 5)
{
tree->berryYield = CalcBerryYield(tree);
tree->secondsUntilNextStage *= 4;
}
if (!sparkle)
{
tree->growthSparkle = TRUE;
}
}
void RemoveBerryTree(u8 id)
{
gSaveBlock1.berryTrees[id] = gBlankBerryTree;
}
u8 GetBerryTypeByBerryTreeId(u8 id)
{
return gSaveBlock1.berryTrees[id].berry;
}
u8 GetStageByBerryTreeId(u8 id)
{
return gSaveBlock1.berryTrees[id].stage;
}
u8 ItemIdToBerryType(u16 item)
{
u16 berry = item - FIRST_BERRY;
if (berry > LAST_BERRY - FIRST_BERRY)
return 1;
else
return item - FIRST_BERRY + 1;
}
u16 BerryTypeToItemId(u16 berry)
{
u16 item = berry - 1;
if (item > LAST_BERRY - FIRST_BERRY)
return FIRST_BERRY;
else
return berry + FIRST_BERRY - 1;
}
void GetBerryNameByBerryType(u8 berry, u8 *string)
{
memcpy(string, GetBerryInfo(berry)->name, BERRY_NAME_LENGTH);
string[BERRY_NAME_LENGTH] = EOS;
}
void ResetBerryTreeSparkleFlag(u8 id)
{
GetBerryTreeInfo(id)->growthSparkle = 0;
}
u8 BerryTreeGetNumStagesWatered(struct BerryTree *tree)
{
u8 count = 0;
if (tree->watered1)
count++;
if (tree->watered2)
count++;
if (tree->watered3)
count++;
if (tree->watered4)
count++;
return count;
}
u8 GetNumStagesWateredByBerryTreeId(u8 id)
{
return BerryTreeGetNumStagesWatered(GetBerryTreeInfo(id));
}
u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water)
{
u32 randMin;
u32 randMax;
u32 rand;
u32 extraYield;
if (water == 0)
return min;
else
{
randMin = (max - min) * (water - 1);
randMax = (max - min) * (water);
rand = randMin + Random() % (randMax - randMin + 1);
if ((rand & 3) > 1)
extraYield = rand / 4 + 1;
else
extraYield = rand / 4;
return extraYield + min;
}
}
u8 CalcBerryYield(struct BerryTree *tree)
{
const struct Berry *berry = GetBerryInfo(tree->berry);
u8 min = berry->minYield;
u8 max = berry->maxYield;
return CalcBerryYieldInternal(max, min, BerryTreeGetNumStagesWatered(tree));
}
u8 GetBerryCountByBerryTreeId(u8 id)
{
return gSaveBlock1.berryTrees[id].berryYield;
}
u16 GetStageDurationByBerryType(u8 berry)
{
return GetBerryInfo(berry)->stageDuration * 60;
}
void FieldObjectInteractionGetBerryTreeData(void)
{
u8 id;
u8 berry;
u8 unk;
u8 group;
u8 num;
id = FieldObjectGetBerryTreeId(gSelectedMapObject);
berry = GetBerryTypeByBerryTreeId(id);
ResetBerryTreeSparkleFlag(id);
unk = gScriptLastTalked;
num = gSaveBlock1.location.mapNum;
group = gSaveBlock1.location.mapGroup;
if (sub_8060234(unk, num, group))
gSpecialVar_0x8004 = 0xFF;
else
gSpecialVar_0x8004 = GetStageByBerryTreeId(id);
gSpecialVar_0x8005 = GetNumStagesWateredByBerryTreeId(id);
gSpecialVar_0x8006 = GetBerryCountByBerryTreeId(id);
GetBerryNameByBerryType(berry, gStringVar1);
}
void sub_80B4EE4(void)
{
SetMainCallback2(sub_80A68CC);
}
void FieldObjectInteractionPlantBerryTree(void)
{
u8 berry = ItemIdToBerryType(gScriptItemId);
PlantBerryTree(FieldObjectGetBerryTreeId(gSelectedMapObject), berry, 1, TRUE);
FieldObjectInteractionGetBerryTreeData();
}
void FieldObjectInteractionPickBerryTree(void)
{
u8 id = FieldObjectGetBerryTreeId(gSelectedMapObject);
u8 berry = GetBerryTypeByBerryTreeId(id);
gSpecialVar_0x8004 = AddBagItem(BerryTypeToItemId(berry), GetBerryCountByBerryTreeId(id));
}
void FieldObjectInteractionRemoveBerryTree(void)
{
RemoveBerryTree(FieldObjectGetBerryTreeId(gSelectedMapObject));
sub_8060288(gScriptLastTalked, gSaveBlock1.location.mapNum, gSaveBlock1.location.mapGroup);
}
u8 PlayerHasBerries(void)
{
return IsBagPocketNonEmpty(BAG_BERRIES);
}
void ResetBerryTreeSparkleFlags(void)
{
s16 cam_left;
s16 cam_top;
s16 left;
s16 top;
s16 right;
s16 bottom;
int i;
GetCameraCoords(&cam_left, &cam_top);
left = cam_left;
top = cam_top + 3;
right = cam_left + 14;
bottom = top + 8;
for (i = 0; i < (u8)ARRAY_COUNT(gSaveBlock1.mapObjects); i++)
{
if (gMapObjects[i].active && gMapObjects[i].animPattern == 12)
{
cam_left = gMapObjects[i].coords2.x;
cam_top = gMapObjects[i].coords2.y;
if (left <= cam_left && cam_left <= right && top <= cam_top && cam_top <= bottom)
ResetBerryTreeSparkleFlag(gMapObjects[i].trainerRange_berryTreeId);
}
}
}
|