-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
berry.c
1357 lines (1253 loc) · 42.3 KB
/
berry.c
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
#include "global.h"
#include "berry.h"
#include "event_data.h"
#include "event_object_movement.h"
#include "event_scripts.h"
#include "field_control_avatar.h"
#include "fieldmap.h"
#include "item.h"
#include "item_menu.h"
#include "main.h"
#include "random.h"
#include "string_util.h"
#include "text.h"
#include "constants/event_object_movement.h"
#include "constants/items.h"
static u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry);
static bool32 BerryTreeGrow(struct BerryTree *tree);
static u16 BerryTypeToItemId(u16 berry);
static u8 BerryTreeGetNumStagesWatered(struct BerryTree *tree);
static u8 GetNumStagesWateredByBerryTreeId(u8 id);
static u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water);
static u8 CalcBerryYield(struct BerryTree *tree);
static u8 GetBerryCountByBerryTreeId(u8 id);
static u16 GetStageDurationByBerryType(u8);
//.rodata
static const u8 sBerryDescriptionPart1_Cheri[] = _("Blooms with delicate pretty flowers.");
static const u8 sBerryDescriptionPart2_Cheri[] = _("The bright red BERRY is very spicy.");
static const u8 sBerryDescriptionPart1_Chesto[] = _("The BERRY's thick skin and fruit are");
static const u8 sBerryDescriptionPart2_Chesto[] = _("very tough. It is dry-tasting all over.");
static const u8 sBerryDescriptionPart1_Pecha[] = _("Very sweet and delicious.");
static const u8 sBerryDescriptionPart2_Pecha[] = _("Also very tender - handle with care.");
static const u8 sBerryDescriptionPart1_Rawst[] = _("If the leaves grow long and curly,");
static const u8 sBerryDescriptionPart2_Rawst[] = _("the BERRY seems to grow very bitter.");
static const u8 sBerryDescriptionPart1_Aspear[] = _("The hard BERRY is dense with a rich");
static const u8 sBerryDescriptionPart2_Aspear[] = _("juice. It is quite sour.");
static const u8 sBerryDescriptionPart1_Leppa[] = _("Grows slower than CHERI and others.");
static const u8 sBerryDescriptionPart2_Leppa[] = _("The smaller the BERRY, the tastier.");
static const u8 sBerryDescriptionPart1_Oran[] = _("A peculiar BERRY with a mix of flavors.");
static const u8 sBerryDescriptionPart2_Oran[] = _("BERRIES grow in half a day.");
static const u8 sBerryDescriptionPart1_Persim[] = _("Loves sunlight. The BERRY's color");
static const u8 sBerryDescriptionPart2_Persim[] = _("grows vivid when exposed to the sun.");
static const u8 sBerryDescriptionPart1_Lum[] = _("Slow to grow. If raised with loving");
static const u8 sBerryDescriptionPart2_Lum[] = _("care, it may grow two BERRIES.");
static const u8 sBerryDescriptionPart1_Sitrus[] = _("Closely related to ORAN. The large");
static const u8 sBerryDescriptionPart2_Sitrus[] = _("BERRY has a well-rounded flavor.");
static const u8 sBerryDescriptionPart1_Figy[] = _("The BERRY, which looks chewed up,");
static const u8 sBerryDescriptionPart2_Figy[] = _("brims with spicy substances.");
static const u8 sBerryDescriptionPart1_Wiki[] = _("The BERRY is said to have grown lumpy");
static const u8 sBerryDescriptionPart2_Wiki[] = _("to help POKéMON grip it.");
static const u8 sBerryDescriptionPart1_Mago[] = _("The BERRY turns curvy as it grows.");
static const u8 sBerryDescriptionPart2_Mago[] = _("The curvier, the sweeter and tastier.");
static const u8 sBerryDescriptionPart1_Aguav[] = _("The flower is dainty. It is rare in its");
static const u8 sBerryDescriptionPart2_Aguav[] = _("ability to grow without light.");
static const u8 sBerryDescriptionPart1_Iapapa[] = _("The BERRY is very big and sour.");
static const u8 sBerryDescriptionPart2_Iapapa[] = _("It takes at least a day to grow.");
static const u8 sBerryDescriptionPart1_Razz[] = _("The red BERRY tastes slightly spicy.");
static const u8 sBerryDescriptionPart2_Razz[] = _("It grows quickly in just four hours.");
static const u8 sBerryDescriptionPart1_Bluk[] = _("The BERRY is blue on the outside, but");
static const u8 sBerryDescriptionPart2_Bluk[] = _("it blackens the mouth when eaten.");
static const u8 sBerryDescriptionPart1_Nanab[] = _("This BERRY was the seventh");
static const u8 sBerryDescriptionPart2_Nanab[] = _("discovered in the world. It is sweet.");
static const u8 sBerryDescriptionPart1_Wepear[] = _("The flower is small and white. It has a");
static const u8 sBerryDescriptionPart2_Wepear[] = _("delicate balance of bitter and sour.");
static const u8 sBerryDescriptionPart1_Pinap[] = _("Weak against wind and cold.");
static const u8 sBerryDescriptionPart2_Pinap[] = _("The fruit is spicy and the skin, sour.");
static const u8 sBerryDescriptionPart1_Pomeg[] = _("However much it is watered,");
static const u8 sBerryDescriptionPart2_Pomeg[] = _("it only grows up to six BERRIES.");
static const u8 sBerryDescriptionPart1_Kelpsy[] = _("A rare variety shaped like a root.");
static const u8 sBerryDescriptionPart2_Kelpsy[] = _("Grows a very large flower.");
static const u8 sBerryDescriptionPart1_Qualot[] = _("Loves water. Grows strong even in");
static const u8 sBerryDescriptionPart2_Qualot[] = _("locations with constant rainfall.");
static const u8 sBerryDescriptionPart1_Hondew[] = _("A BERRY that is very valuable and");
static const u8 sBerryDescriptionPart2_Hondew[] = _("rarely seen. It is very delicious.");
static const u8 sBerryDescriptionPart1_Grepa[] = _("Despite its tenderness and round");
static const u8 sBerryDescriptionPart2_Grepa[] = _("shape, the BERRY is unimaginably sour.");
static const u8 sBerryDescriptionPart1_Tamato[] = _("The BERRY is lip-bendingly spicy.");
static const u8 sBerryDescriptionPart2_Tamato[] = _("It takes time to grow.");
static const u8 sBerryDescriptionPart1_Cornn[] = _("A BERRY from an ancient era. May not");
static const u8 sBerryDescriptionPart2_Cornn[] = _("grow unless planted in quantity.");
static const u8 sBerryDescriptionPart1_Magost[] = _("A BERRY that is widely said to have");
static const u8 sBerryDescriptionPart2_Magost[] = _("a finely balanced flavor.");
static const u8 sBerryDescriptionPart1_Rabuta[] = _("A rare variety that is overgrown with");
static const u8 sBerryDescriptionPart2_Rabuta[] = _("hair. It is quite bitter.");
static const u8 sBerryDescriptionPart1_Nomel[] = _("Quite sour. Just one bite makes it");
static const u8 sBerryDescriptionPart2_Nomel[] = _("impossible to taste for three days.");
static const u8 sBerryDescriptionPart1_Spelon[] = _("The vividly red BERRY is very spicy.");
static const u8 sBerryDescriptionPart2_Spelon[] = _("Its warts secrete a spicy substance.");
static const u8 sBerryDescriptionPart1_Pamtre[] = _("Drifts on the sea from somewhere.");
static const u8 sBerryDescriptionPart2_Pamtre[] = _("It is thought to grow elsewhere.");
static const u8 sBerryDescriptionPart1_Watmel[] = _("A huge BERRY, with some over 20");
static const u8 sBerryDescriptionPart2_Watmel[] = _("inches discovered. Exceedingly sweet.");
static const u8 sBerryDescriptionPart1_Durin[] = _("Bitter to even look at. It is so");
static const u8 sBerryDescriptionPart2_Durin[] = _("bitter, no one has ever eaten it as is.");
static const u8 sBerryDescriptionPart1_Belue[] = _("It is glossy and looks delicious, but");
static const u8 sBerryDescriptionPart2_Belue[] = _("it is awfully sour. Takes time to grow.");
static const u8 sBerryDescriptionPart1_Liechi[] = _("A mysterious BERRY. It is rumored to");
static const u8 sBerryDescriptionPart2_Liechi[] = _("contain the power of the sea.");
static const u8 sBerryDescriptionPart1_Ganlon[] = _("A mysterious BERRY. It is rumored to");
static const u8 sBerryDescriptionPart2_Ganlon[] = _("contain the power of the land.");
static const u8 sBerryDescriptionPart1_Salac[] = _("A mysterious BERRY. It is rumored to");
static const u8 sBerryDescriptionPart2_Salac[] = _("contain the power of the sky.");
static const u8 sBerryDescriptionPart1_Petaya[] = _("A mysterious BERRY. It is rumored to");
static const u8 sBerryDescriptionPart2_Petaya[] = _("contain the power of all living things.");
static const u8 sBerryDescriptionPart1_Apicot[] = _("A very mystifying BERRY. No telling");
static const u8 sBerryDescriptionPart2_Apicot[] = _("what may happen or how it can be used.");
static const u8 sBerryDescriptionPart1_Lansat[] = _("Said to be a legendary BERRY.");
static const u8 sBerryDescriptionPart2_Lansat[] = _("Holding it supposedly brings joy.");
static const u8 sBerryDescriptionPart1_Starf[] = _("So strong, it was abandoned at the");
static const u8 sBerryDescriptionPart2_Starf[] = _("world's edge. Considered a mirage.");
static const u8 sBerryDescriptionPart1_Enigma[] = _("A completely enigmatic BERRY.");
static const u8 sBerryDescriptionPart2_Enigma[] = _("Appears to have the power of stars.");
const struct Berry gBerries[] =
{
[ITEM_CHERI_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("CHERI"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 20,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Cheri,
.description2 = sBerryDescriptionPart2_Cheri,
.stageDuration = 3,
.spicy = 10,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 25,
},
[ITEM_CHESTO_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("CHESTO"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 80,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Chesto,
.description2 = sBerryDescriptionPart2_Chesto,
.stageDuration = 3,
.spicy = 0,
.dry = 10,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 25,
},
[ITEM_PECHA_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("PECHA"),
.firmness = BERRY_FIRMNESS_VERY_SOFT,
.size = 40,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Pecha,
.description2 = sBerryDescriptionPart2_Pecha,
.stageDuration = 3,
.spicy = 0,
.dry = 0,
.sweet = 10,
.bitter = 0,
.sour = 0,
.smoothness = 25,
},
[ITEM_RAWST_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("RAWST"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 32,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Rawst,
.description2 = sBerryDescriptionPart2_Rawst,
.stageDuration = 3,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 10,
.sour = 0,
.smoothness = 25,
},
[ITEM_ASPEAR_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("ASPEAR"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 50,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Aspear,
.description2 = sBerryDescriptionPart2_Aspear,
.stageDuration = 3,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 10,
.smoothness = 25,
},
[ITEM_LEPPA_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("LEPPA"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 28,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Leppa,
.description2 = sBerryDescriptionPart2_Leppa,
.stageDuration = 4,
.spicy = 10,
.dry = 0,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
[ITEM_ORAN_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("ORAN"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 35,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Oran,
.description2 = sBerryDescriptionPart2_Oran,
.stageDuration = 3,
.spicy = 10,
.dry = 10,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
[ITEM_PERSIM_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("PERSIM"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 47,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Persim,
.description2 = sBerryDescriptionPart2_Persim,
.stageDuration = 3,
.spicy = 10,
.dry = 10,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
[ITEM_LUM_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("LUM"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 34,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Lum,
.description2 = sBerryDescriptionPart2_Lum,
.stageDuration = 12,
.spicy = 10,
.dry = 10,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
[ITEM_SITRUS_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("SITRUS"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 95,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Sitrus,
.description2 = sBerryDescriptionPart2_Sitrus,
.stageDuration = 6,
.spicy = 10,
.dry = 10,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
[ITEM_FIGY_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("FIGY"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 100,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Figy,
.description2 = sBerryDescriptionPart2_Figy,
.stageDuration = 6,
.spicy = 10,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 25,
},
[ITEM_WIKI_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("WIKI"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 115,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Wiki,
.description2 = sBerryDescriptionPart2_Wiki,
.stageDuration = 6,
.spicy = 0,
.dry = 10,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 25,
},
[ITEM_MAGO_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("MAGO"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 126,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Mago,
.description2 = sBerryDescriptionPart2_Mago,
.stageDuration = 6,
.spicy = 0,
.dry = 0,
.sweet = 10,
.bitter = 0,
.sour = 0,
.smoothness = 25,
},
[ITEM_AGUAV_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("AGUAV"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 64,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Aguav,
.description2 = sBerryDescriptionPart2_Aguav,
.stageDuration = 6,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 10,
.sour = 0,
.smoothness = 25,
},
[ITEM_IAPAPA_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("IAPAPA"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 223,
.maxYield = 3,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Iapapa,
.description2 = sBerryDescriptionPart2_Iapapa,
.stageDuration = 6,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 10,
.smoothness = 25,
},
[ITEM_RAZZ_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("RAZZ"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 120,
.maxYield = 6,
.minYield = 3,
.description1 = sBerryDescriptionPart1_Razz,
.description2 = sBerryDescriptionPart2_Razz,
.stageDuration = 1,
.spicy = 10,
.dry = 10,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 20,
},
[ITEM_BLUK_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("BLUK"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 108,
.maxYield = 6,
.minYield = 3,
.description1 = sBerryDescriptionPart1_Bluk,
.description2 = sBerryDescriptionPart2_Bluk,
.stageDuration = 1,
.spicy = 0,
.dry = 10,
.sweet = 10,
.bitter = 0,
.sour = 0,
.smoothness = 20,
},
[ITEM_NANAB_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("NANAB"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 77,
.maxYield = 6,
.minYield = 3,
.description1 = sBerryDescriptionPart1_Nanab,
.description2 = sBerryDescriptionPart2_Nanab,
.stageDuration = 1,
.spicy = 0,
.dry = 0,
.sweet = 10,
.bitter = 10,
.sour = 0,
.smoothness = 20,
},
[ITEM_WEPEAR_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("WEPEAR"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 74,
.maxYield = 6,
.minYield = 3,
.description1 = sBerryDescriptionPart1_Wepear,
.description2 = sBerryDescriptionPart2_Wepear,
.stageDuration = 1,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
[ITEM_PINAP_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("PINAP"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 80,
.maxYield = 6,
.minYield = 3,
.description1 = sBerryDescriptionPart1_Pinap,
.description2 = sBerryDescriptionPart2_Pinap,
.stageDuration = 1,
.spicy = 10,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 10,
.smoothness = 20,
},
[ITEM_POMEG_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("POMEG"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 135,
.maxYield = 6,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Pomeg,
.description2 = sBerryDescriptionPart2_Pomeg,
.stageDuration = 3,
.spicy = 10,
.dry = 0,
.sweet = 10,
.bitter = 10,
.sour = 0,
.smoothness = 20,
},
[ITEM_KELPSY_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("KELPSY"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 150,
.maxYield = 6,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Kelpsy,
.description2 = sBerryDescriptionPart2_Kelpsy,
.stageDuration = 3,
.spicy = 0,
.dry = 10,
.sweet = 0,
.bitter = 10,
.sour = 10,
.smoothness = 20,
},
[ITEM_QUALOT_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("QUALOT"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 110,
.maxYield = 6,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Qualot,
.description2 = sBerryDescriptionPart2_Qualot,
.stageDuration = 3,
.spicy = 10,
.dry = 0,
.sweet = 10,
.bitter = 0,
.sour = 10,
.smoothness = 20,
},
[ITEM_HONDEW_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("HONDEW"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 162,
.maxYield = 6,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Hondew,
.description2 = sBerryDescriptionPart2_Hondew,
.stageDuration = 3,
.spicy = 10,
.dry = 10,
.sweet = 0,
.bitter = 10,
.sour = 0,
.smoothness = 20,
},
[ITEM_GREPA_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("GREPA"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 149,
.maxYield = 6,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Grepa,
.description2 = sBerryDescriptionPart2_Grepa,
.stageDuration = 3,
.spicy = 0,
.dry = 10,
.sweet = 10,
.bitter = 0,
.sour = 10,
.smoothness = 20,
},
[ITEM_TAMATO_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("TAMATO"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 200,
.maxYield = 4,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Tamato,
.description2 = sBerryDescriptionPart2_Tamato,
.stageDuration = 6,
.spicy = 20,
.dry = 10,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 30,
},
[ITEM_CORNN_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("CORNN"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 75,
.maxYield = 4,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Cornn,
.description2 = sBerryDescriptionPart2_Cornn,
.stageDuration = 6,
.spicy = 0,
.dry = 20,
.sweet = 10,
.bitter = 0,
.sour = 0,
.smoothness = 30,
},
[ITEM_MAGOST_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("MAGOST"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 140,
.maxYield = 4,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Magost,
.description2 = sBerryDescriptionPart2_Magost,
.stageDuration = 6,
.spicy = 0,
.dry = 0,
.sweet = 20,
.bitter = 10,
.sour = 0,
.smoothness = 30,
},
[ITEM_RABUTA_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("RABUTA"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 226,
.maxYield = 4,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Rabuta,
.description2 = sBerryDescriptionPart2_Rabuta,
.stageDuration = 6,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 20,
.sour = 10,
.smoothness = 30,
},
[ITEM_NOMEL_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("NOMEL"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 285,
.maxYield = 4,
.minYield = 2,
.description1 = sBerryDescriptionPart1_Nomel,
.description2 = sBerryDescriptionPart2_Nomel,
.stageDuration = 6,
.spicy = 10,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 20,
.smoothness = 30,
},
[ITEM_SPELON_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("SPELON"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 133,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Spelon,
.description2 = sBerryDescriptionPart2_Spelon,
.stageDuration = 18,
.spicy = 40,
.dry = 10,
.sweet = 0,
.bitter = 0,
.sour = 0,
.smoothness = 70,
},
[ITEM_PAMTRE_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("PAMTRE"),
.firmness = BERRY_FIRMNESS_VERY_SOFT,
.size = 244,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Pamtre,
.description2 = sBerryDescriptionPart2_Pamtre,
.stageDuration = 18,
.spicy = 0,
.dry = 40,
.sweet = 10,
.bitter = 0,
.sour = 0,
.smoothness = 70,
},
[ITEM_WATMEL_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("WATMEL"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 250,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Watmel,
.description2 = sBerryDescriptionPart2_Watmel,
.stageDuration = 18,
.spicy = 0,
.dry = 0,
.sweet = 40,
.bitter = 10,
.sour = 0,
.smoothness = 70,
},
[ITEM_DURIN_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("DURIN"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 280,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Durin,
.description2 = sBerryDescriptionPart2_Durin,
.stageDuration = 18,
.spicy = 0,
.dry = 0,
.sweet = 0,
.bitter = 40,
.sour = 10,
.smoothness = 70,
},
[ITEM_BELUE_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("BELUE"),
.firmness = BERRY_FIRMNESS_VERY_SOFT,
.size = 300,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Belue,
.description2 = sBerryDescriptionPart2_Belue,
.stageDuration = 18,
.spicy = 10,
.dry = 0,
.sweet = 0,
.bitter = 0,
.sour = 40,
.smoothness = 70,
},
[ITEM_LIECHI_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("LIECHI"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 111,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Liechi,
.description2 = sBerryDescriptionPart2_Liechi,
.stageDuration = 24,
.spicy = 40,
.dry = 0,
.sweet = 40,
.bitter = 0,
.sour = 10,
.smoothness = 80,
},
[ITEM_GANLON_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("GANLON"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 33,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Ganlon,
.description2 = sBerryDescriptionPart2_Ganlon,
.stageDuration = 24,
.spicy = 0,
.dry = 40,
.sweet = 0,
.bitter = 40,
.sour = 0,
.smoothness = 80,
},
[ITEM_SALAC_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("SALAC"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 95,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Salac,
.description2 = sBerryDescriptionPart2_Salac,
.stageDuration = 24,
.spicy = 0,
.dry = 0,
.sweet = 40,
.bitter = 0,
.sour = 40,
.smoothness = 80,
},
[ITEM_PETAYA_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("PETAYA"),
.firmness = BERRY_FIRMNESS_VERY_HARD,
.size = 237,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Petaya,
.description2 = sBerryDescriptionPart2_Petaya,
.stageDuration = 24,
.spicy = 40,
.dry = 0,
.sweet = 0,
.bitter = 40,
.sour = 0,
.smoothness = 80,
},
[ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("APICOT"),
.firmness = BERRY_FIRMNESS_HARD,
.size = 75,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Apicot,
.description2 = sBerryDescriptionPart2_Apicot,
.stageDuration = 24,
.spicy = 0,
.dry = 40,
.sweet = 0,
.bitter = 0,
.sour = 40,
.smoothness = 80,
},
[ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("LANSAT"),
.firmness = BERRY_FIRMNESS_SOFT,
.size = 97,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Lansat,
.description2 = sBerryDescriptionPart2_Lansat,
.stageDuration = 24,
.spicy = 10,
.dry = 10,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 30,
},
[ITEM_STARF_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("STARF"),
.firmness = BERRY_FIRMNESS_SUPER_HARD,
.size = 153,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Starf,
.description2 = sBerryDescriptionPart2_Starf,
.stageDuration = 24,
.spicy = 10,
.dry = 10,
.sweet = 10,
.bitter = 10,
.sour = 10,
.smoothness = 30,
},
[ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] =
{
.name = _("ENIGMA"),
.firmness = BERRY_FIRMNESS_UNKNOWN,
.size = 0,
.maxYield = 2,
.minYield = 1,
.description1 = sBerryDescriptionPart1_Enigma,
.description2 = sBerryDescriptionPart2_Enigma,
.stageDuration = 24,
.spicy = 40,
.dry = 40,
.sweet = 40,
.bitter = 40,
.sour = 40,
.smoothness = 40,
},
};
const struct BerryCrushBerryData gBerryCrush_BerryData[] = {
[ITEM_CHERI_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 50, .powder = 20},
[ITEM_CHESTO_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 50, .powder = 20},
[ITEM_PECHA_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 50, .powder = 20},
[ITEM_RAWST_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 50, .powder = 20},
[ITEM_ASPEAR_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 50, .powder = 20},
[ITEM_LEPPA_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 50, .powder = 30},
[ITEM_ORAN_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 50, .powder = 30},
[ITEM_PERSIM_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 50, .powder = 30},
[ITEM_LUM_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 50, .powder = 30},
[ITEM_SITRUS_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 50, .powder = 30},
[ITEM_FIGY_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 60, .powder = 50},
[ITEM_WIKI_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 60, .powder = 50},
[ITEM_MAGO_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 60, .powder = 50},
[ITEM_AGUAV_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 60, .powder = 50},
[ITEM_IAPAPA_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 60, .powder = 50},
[ITEM_RAZZ_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 80, .powder = 70},
[ITEM_BLUK_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 80, .powder = 70},
[ITEM_NANAB_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 80, .powder = 70},
[ITEM_WEPEAR_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 80, .powder = 70},
[ITEM_PINAP_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 80, .powder = 70},
[ITEM_POMEG_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 100, .powder = 100},
[ITEM_KELPSY_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 100, .powder = 100},
[ITEM_QUALOT_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 100, .powder = 100},
[ITEM_HONDEW_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 100, .powder = 100},
[ITEM_GREPA_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 100, .powder = 100},
[ITEM_TAMATO_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 130, .powder = 150},
[ITEM_CORNN_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 130, .powder = 150},
[ITEM_MAGOST_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 130, .powder = 150},
[ITEM_RABUTA_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 130, .powder = 150},
[ITEM_NOMEL_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 130, .powder = 150},
[ITEM_SPELON_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 160, .powder = 250},
[ITEM_PAMTRE_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 160, .powder = 250},
[ITEM_WATMEL_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 160, .powder = 250},
[ITEM_DURIN_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 160, .powder = 250},
[ITEM_BELUE_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 160, .powder = 250},
[ITEM_LIECHI_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 180, .powder = 500},
[ITEM_GANLON_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 180, .powder = 500},
[ITEM_SALAC_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 180, .powder = 500},
[ITEM_PETAYA_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 180, .powder = 500},
[ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 180, .powder = 500},
[ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 200, .powder = 750},
[ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 200, .powder = 750},
[ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 150, .powder = 200}
};
const struct BerryTree gBlankBerryTree = {};
// unused
void ClearEnigmaBerries(void)
{
CpuFill16(0, &gSaveBlock1Ptr->enigmaBerry, sizeof(gSaveBlock1Ptr->enigmaBerry));
}
void SetEnigmaBerry(u8 *src)
{
u32 i;
u8 *dest = (u8 *)&gSaveBlock1Ptr->enigmaBerry;
for (i = 0; i < sizeof(gSaveBlock1Ptr->enigmaBerry); i++)
dest[i] = src[i];
}
static u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry)
{
u32 i;
u32 checksum;
u8 *dest;
dest = (u8 *)enigmaBerry;
checksum = 0;
for (i = 0; i < sizeof(gSaveBlock1Ptr->enigmaBerry) - sizeof(gSaveBlock1Ptr->enigmaBerry.checksum); i++)
checksum += dest[i];
return checksum;
}
bool32 IsEnigmaBerryValid(void)
{
if (!gSaveBlock1Ptr->enigmaBerry.berry.stageDuration)
return FALSE;
if (!gSaveBlock1Ptr->enigmaBerry.berry.maxYield)
return FALSE;
if (GetEnigmaBerryChecksum(&gSaveBlock1Ptr->enigmaBerry) != gSaveBlock1Ptr->enigmaBerry.checksum)
return FALSE;
return TRUE;
}
const struct Berry *GetBerryInfo(u8 berry)
{
if (berry == ITEM_TO_BERRY(ITEM_ENIGMA_BERRY) && IsEnigmaBerryValid())
{
return (struct Berry *)(&gSaveBlock1Ptr->enigmaBerry.berry);
}
else
{
if (berry == BERRY_NONE || berry > ITEM_TO_BERRY(LAST_BERRY_INDEX))
berry = ITEM_TO_BERRY(FIRST_BERRY_INDEX);
return &gBerries[berry - 1];
}
}
struct BerryTree *GetBerryTreeInfo(u8 id)
{
return &gSaveBlock1Ptr->berryTrees[id];
}
bool32 ObjectEventInteractionWaterBerryTree(void)
{