Renamed INDEX_BERRY -> BERRY_ID + review comments

This commit is contained in:
Nephrite 2026-03-21 15:29:08 +00:00
parent 8a58f120be
commit b3fc5f1d27
22 changed files with 263 additions and 263 deletions

View File

@ -1279,14 +1279,14 @@
.endm .endm
@ Sets a berry tree's berry and growth stage. treeId is any BERRY_TREE_* constant (an index into berryTrees in SaveBlock1), @ Sets a berry tree's berry and growth stage. treeId is any BERRY_TREE_* constant (an index into berryTrees in SaveBlock1),
@ berryIndex is any INDEX_X_BERRY value, and growthStage is any BERRY_STAGE_* constant. @ berryId is any BERRY_ID_X value, and growthStage is any BERRY_STAGE_* constant.
.macro setberrytree treeId:req, berryIndex:req, growthStage:req .macro setberrytree treeId:req, berryId:req, growthStage:req
.if \berryIndex == 0 || \berryIndex > NUM_BERRIES .if \berryId == 0 || \berryId > NUM_BERRIES
.error "setberrytree must use a valid berry index" .error "setberrytree must use a valid berry index"
.endif .endif
.byte SCR_OP_SETBERRYTREE .byte SCR_OP_SETBERRYTREE
.byte \treeId .byte \treeId
.byte \berryIndex .byte \berryId
.byte \growthStage .byte \growthStage
.endm .endm

View File

@ -36,7 +36,7 @@ LilycoveCity_EventScript_BerryGentleman::
dotimebasedevents dotimebasedevents
goto_if_set FLAG_DAILY_LILYCOVE_RECEIVED_BERRY, LilycoveCity_EventScript_ReceivedBerry goto_if_set FLAG_DAILY_LILYCOVE_RECEIVED_BERRY, LilycoveCity_EventScript_ReceivedBerry
msgbox LilycoveCity_Text_BerrySuitsYou, MSGBOX_DEFAULT msgbox LilycoveCity_Text_BerrySuitsYou, MSGBOX_DEFAULT
giverandomberry INDEX_CHERI_BERRY, INDEX_SITRUS_BERRY giverandomberry BERRY_ID_CHERI, BERRY_ID_SITRUS
goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull
setflag FLAG_DAILY_LILYCOVE_RECEIVED_BERRY setflag FLAG_DAILY_LILYCOVE_RECEIVED_BERRY
msgbox LilycoveCity_Text_BecauseYoureTrainer, MSGBOX_DEFAULT msgbox LilycoveCity_Text_BecauseYoureTrainer, MSGBOX_DEFAULT

View File

@ -82,7 +82,7 @@ Route104_PrettyPetalFlowerShop_EventScript_RandomBerryGirl::
dotimebasedevents dotimebasedevents
goto_if_set FLAG_DAILY_FLOWER_SHOP_RECEIVED_BERRY, Route104_PrettyPetalFlowerShop_EventScript_AlreadyReceivedBerry goto_if_set FLAG_DAILY_FLOWER_SHOP_RECEIVED_BERRY, Route104_PrettyPetalFlowerShop_EventScript_AlreadyReceivedBerry
msgbox Route104_PrettyPetalFlowerShop_Text_ImGrowingFlowers, MSGBOX_DEFAULT msgbox Route104_PrettyPetalFlowerShop_Text_ImGrowingFlowers, MSGBOX_DEFAULT
giverandomberry INDEX_CHERI_BERRY, INDEX_PERSIM_BERRY giverandomberry BERRY_ID_CHERI, BERRY_ID_PERSIM
goto_if_eq VAR_RESULT, 0, Common_EventScript_ShowBagIsFull goto_if_eq VAR_RESULT, 0, Common_EventScript_ShowBagIsFull
setflag FLAG_DAILY_FLOWER_SHOP_RECEIVED_BERRY setflag FLAG_DAILY_FLOWER_SHOP_RECEIVED_BERRY
msgbox Route104_PrettyPetalFlowerShop_Text_MachineMixesBerries, MSGBOX_DEFAULT msgbox Route104_PrettyPetalFlowerShop_Text_MachineMixesBerries, MSGBOX_DEFAULT

View File

@ -25,7 +25,7 @@ Route114_EventScript_Man::
dotimebasedevents dotimebasedevents
goto_if_set FLAG_DAILY_ROUTE_114_RECEIVED_BERRY, Route114_EventScript_ReceivedBerry goto_if_set FLAG_DAILY_ROUTE_114_RECEIVED_BERRY, Route114_EventScript_ReceivedBerry
msgbox Route114_Text_LoveUsingBerryCrushShareBerry, MSGBOX_DEFAULT msgbox Route114_Text_LoveUsingBerryCrushShareBerry, MSGBOX_DEFAULT
giverandomberry INDEX_RAZZ_BERRY, INDEX_PINAP_BERRY giverandomberry BERRY_ID_RAZZ, BERRY_ID_PINAP
goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull
setflag FLAG_DAILY_ROUTE_114_RECEIVED_BERRY setflag FLAG_DAILY_ROUTE_114_RECEIVED_BERRY
msgbox Route114_Text_TryBerryCrushWithFriends, MSGBOX_DEFAULT msgbox Route114_Text_TryBerryCrushWithFriends, MSGBOX_DEFAULT

View File

@ -12,11 +12,11 @@ Route123_BerryMastersHouse_EventScript_BerryMaster::
dotimebasedevents dotimebasedevents
goto_if_set FLAG_DAILY_BERRY_MASTER_RECEIVED_BERRY, Route123_BerryMastersHouse_EventScript_ReceivedBerryToday goto_if_set FLAG_DAILY_BERRY_MASTER_RECEIVED_BERRY, Route123_BerryMastersHouse_EventScript_ReceivedBerryToday
msgbox Route123_BerryMastersHouse_Text_YoureDeservingOfBerry, MSGBOX_DEFAULT msgbox Route123_BerryMastersHouse_Text_YoureDeservingOfBerry, MSGBOX_DEFAULT
giverandomberry INDEX_POMEG_BERRY, INDEX_NOMEL_BERRY giverandomberry BERRY_ID_POMEG, BERRY_ID_NOMEL
goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull
setflag FLAG_DAILY_BERRY_MASTER_RECEIVED_BERRY setflag FLAG_DAILY_BERRY_MASTER_RECEIVED_BERRY
msgbox Route123_BerryMastersHouse_Text_WhyBeStingyTakeAnother, MSGBOX_DEFAULT msgbox Route123_BerryMastersHouse_Text_WhyBeStingyTakeAnother, MSGBOX_DEFAULT
giverandomberry INDEX_POMEG_BERRY, INDEX_NOMEL_BERRY giverandomberry BERRY_ID_POMEG, BERRY_ID_NOMEL
goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull
msgbox Route123_BerryMastersHouse_Text_VisitPrettyPetalFlowerShop, MSGBOX_DEFAULT msgbox Route123_BerryMastersHouse_Text_VisitPrettyPetalFlowerShop, MSGBOX_DEFAULT
release release
@ -58,7 +58,7 @@ Route123_BerryMastersHouse_EventScript_GavePhrase::
Route123_BerryMastersHouse_EventScript_GiveNormalBerry:: Route123_BerryMastersHouse_EventScript_GiveNormalBerry::
msgbox Route123_BerryMastersHouse_Text_GoodSayingTakeThis, MSGBOX_DEFAULT msgbox Route123_BerryMastersHouse_Text_GoodSayingTakeThis, MSGBOX_DEFAULT
giverandomberry INDEX_CHERI_BERRY, INDEX_SITRUS_BERRY giverandomberry BERRY_ID_CHERI, BERRY_ID_SITRUS
goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull
goto Route123_BerryMastersHouse_EventScript_GaveBerry goto Route123_BerryMastersHouse_EventScript_GaveBerry
release release

View File

@ -714,7 +714,7 @@ SootopolisCity_EventScript_KiriGiveBerry::
special GetPlayerBigGuyGirlString special GetPlayerBigGuyGirlString
goto_if_set FLAG_DAILY_SOOTOPOLIS_RECEIVED_BERRY, SootopolisCity_EventScript_KiriReceivedBerry goto_if_set FLAG_DAILY_SOOTOPOLIS_RECEIVED_BERRY, SootopolisCity_EventScript_KiriReceivedBerry
msgbox SootopolisCity_Text_NameIsKiriHaveOneOfThese, MSGBOX_DEFAULT msgbox SootopolisCity_Text_NameIsKiriHaveOneOfThese, MSGBOX_DEFAULT
giverandomberry INDEX_POMEG_BERRY, INDEX_NOMEL_BERRY giverandomberry BERRY_ID_POMEG, BERRY_ID_NOMEL
goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull
setflag FLAG_DAILY_SOOTOPOLIS_RECEIVED_BERRY setflag FLAG_DAILY_SOOTOPOLIS_RECEIVED_BERRY
msgbox SootopolisCity_Text_GiveYouThisBerryToo, MSGBOX_DEFAULT msgbox SootopolisCity_Text_GiveYouThisBerryToo, MSGBOX_DEFAULT

View File

@ -1,115 +1,115 @@
EventScript_ResetAllBerries:: EventScript_ResetAllBerries::
@ Route 102 @ Route 102
setberrytree BERRY_TREE_ROUTE_102_ORAN, INDEX_ORAN_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_102_ORAN, BERRY_ID_ORAN, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_102_PECHA, INDEX_PECHA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_102_PECHA, BERRY_ID_PECHA, BERRY_STAGE_BERRIES
@ Route 104 @ Route 104
setberrytree BERRY_TREE_ROUTE_104_ORAN_2, INDEX_ORAN_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_104_ORAN_2, BERRY_ID_ORAN, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_104_PECHA, INDEX_PECHA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_104_PECHA, BERRY_ID_PECHA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_104_ORAN_1, INDEX_ORAN_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_104_ORAN_1, BERRY_ID_ORAN, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_104_CHERI_2, INDEX_CHERI_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_104_CHERI_2, BERRY_ID_CHERI, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_104_CHERI_1, INDEX_CHERI_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_104_CHERI_1, BERRY_ID_CHERI, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_104_LEPPA, INDEX_LEPPA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_104_LEPPA, BERRY_ID_LEPPA, BERRY_STAGE_BERRIES
@ Route 116 @ Route 116
setberrytree BERRY_TREE_ROUTE_116_PINAP_1, INDEX_PINAP_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_116_PINAP_1, BERRY_ID_PINAP, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_116_CHESTO_1, INDEX_CHESTO_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_116_CHESTO_1, BERRY_ID_CHESTO, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_116_CHESTO_2, INDEX_CHESTO_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_116_CHESTO_2, BERRY_ID_CHESTO, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_116_PINAP_2, INDEX_PINAP_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_116_PINAP_2, BERRY_ID_PINAP, BERRY_STAGE_BERRIES
@ Route 115 @ Route 115
setberrytree BERRY_TREE_ROUTE_115_KELPSY_1, INDEX_KELPSY_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_115_KELPSY_1, BERRY_ID_KELPSY, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_115_KELPSY_2, INDEX_KELPSY_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_115_KELPSY_2, BERRY_ID_KELPSY, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_115_KELPSY_3, INDEX_KELPSY_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_115_KELPSY_3, BERRY_ID_KELPSY, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_115_BLUK_1, INDEX_BLUK_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_115_BLUK_1, BERRY_ID_BLUK, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_115_BLUK_2, INDEX_BLUK_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_115_BLUK_2, BERRY_ID_BLUK, BERRY_STAGE_BERRIES
@ Route 103 @ Route 103
setberrytree BERRY_TREE_ROUTE_103_CHERI_1, INDEX_CHERI_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_103_CHERI_1, BERRY_ID_CHERI, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_103_LEPPA, INDEX_LEPPA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_103_LEPPA, BERRY_ID_LEPPA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_103_CHERI_2, INDEX_CHERI_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_103_CHERI_2, BERRY_ID_CHERI, BERRY_STAGE_BERRIES
@ Route 110 @ Route 110
setberrytree BERRY_TREE_ROUTE_110_NANAB_1, INDEX_NANAB_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_110_NANAB_1, BERRY_ID_NANAB, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_110_NANAB_2, INDEX_NANAB_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_110_NANAB_2, BERRY_ID_NANAB, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_110_NANAB_3, INDEX_NANAB_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_110_NANAB_3, BERRY_ID_NANAB, BERRY_STAGE_BERRIES
@ Route 117 @ Route 117
setberrytree BERRY_TREE_ROUTE_117_WEPEAR_3, INDEX_WEPEAR_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_117_WEPEAR_3, BERRY_ID_WEPEAR, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_117_WEPEAR_2, INDEX_WEPEAR_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_117_WEPEAR_2, BERRY_ID_WEPEAR, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_117_WEPEAR_1, INDEX_WEPEAR_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_117_WEPEAR_1, BERRY_ID_WEPEAR, BERRY_STAGE_BERRIES
@ Route 112 @ Route 112
setberrytree BERRY_TREE_ROUTE_112_RAWST_2, INDEX_RAWST_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_112_RAWST_2, BERRY_ID_RAWST, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_112_PECHA_2, INDEX_PECHA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_112_PECHA_2, BERRY_ID_PECHA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_112_PECHA_1, INDEX_PECHA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_112_PECHA_1, BERRY_ID_PECHA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_112_RAWST_1, INDEX_RAWST_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_112_RAWST_1, BERRY_ID_RAWST, BERRY_STAGE_BERRIES
@ Route 111 @ Route 111
setberrytree BERRY_TREE_ROUTE_111_RAZZ_1, INDEX_RAZZ_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_111_RAZZ_1, BERRY_ID_RAZZ, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_111_RAZZ_2, INDEX_RAZZ_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_111_RAZZ_2, BERRY_ID_RAZZ, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_111_ORAN_1, INDEX_ORAN_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_111_ORAN_1, BERRY_ID_ORAN, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_111_ORAN_2, INDEX_ORAN_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_111_ORAN_2, BERRY_ID_ORAN, BERRY_STAGE_BERRIES
@ Route 114 @ Route 114
setberrytree BERRY_TREE_ROUTE_114_PERSIM_2, INDEX_PERSIM_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_114_PERSIM_2, BERRY_ID_PERSIM, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_114_PERSIM_3, INDEX_PERSIM_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_114_PERSIM_3, BERRY_ID_PERSIM, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_114_PERSIM_1, INDEX_PERSIM_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_114_PERSIM_1, BERRY_ID_PERSIM, BERRY_STAGE_BERRIES
@ Route 118 @ Route 118
setberrytree BERRY_TREE_ROUTE_118_SITRUS_1, INDEX_SITRUS_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_118_SITRUS_1, BERRY_ID_SITRUS, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_118_SITRUS_2, INDEX_SITRUS_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_118_SITRUS_2, BERRY_ID_SITRUS, BERRY_STAGE_BERRIES
@ Route 119 @ Route 119
setberrytree BERRY_TREE_ROUTE_119_POMEG_1, INDEX_POMEG_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_119_POMEG_1, BERRY_ID_POMEG, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_119_POMEG_2, INDEX_POMEG_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_119_POMEG_2, BERRY_ID_POMEG, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_119_POMEG_3, INDEX_POMEG_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_119_POMEG_3, BERRY_ID_POMEG, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_119_HONDEW_1, INDEX_HONDEW_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_119_HONDEW_1, BERRY_ID_HONDEW, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_119_HONDEW_2, INDEX_HONDEW_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_119_HONDEW_2, BERRY_ID_HONDEW, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_119_SITRUS, INDEX_SITRUS_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_119_SITRUS, BERRY_ID_SITRUS, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_119_LEPPA, INDEX_LEPPA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_119_LEPPA, BERRY_ID_LEPPA, BERRY_STAGE_BERRIES
@ Route 120 @ Route 120
setberrytree BERRY_TREE_ROUTE_120_ASPEAR_1, INDEX_ASPEAR_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_120_ASPEAR_1, BERRY_ID_ASPEAR, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_120_ASPEAR_2, INDEX_ASPEAR_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_120_ASPEAR_2, BERRY_ID_ASPEAR, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_120_ASPEAR_3, INDEX_ASPEAR_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_120_ASPEAR_3, BERRY_ID_ASPEAR, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_120_PECHA_1, INDEX_PECHA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_120_PECHA_1, BERRY_ID_PECHA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_120_PECHA_2, INDEX_PECHA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_120_PECHA_2, BERRY_ID_PECHA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_120_PECHA_3, INDEX_PECHA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_120_PECHA_3, BERRY_ID_PECHA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_120_WEPEAR, INDEX_WEPEAR_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_120_WEPEAR, BERRY_ID_WEPEAR, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_120_PINAP, INDEX_PINAP_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_120_PINAP, BERRY_ID_PINAP, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_120_NANAB, INDEX_NANAB_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_120_NANAB, BERRY_ID_NANAB, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_120_RAZZ, INDEX_RAZZ_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_120_RAZZ, BERRY_ID_RAZZ, BERRY_STAGE_BERRIES
@ Route 121 @ Route 121
setberrytree BERRY_TREE_ROUTE_121_PERSIM, INDEX_PERSIM_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_121_PERSIM, BERRY_ID_PERSIM, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_121_ASPEAR, INDEX_ASPEAR_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_121_ASPEAR, BERRY_ID_ASPEAR, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_121_RAWST, INDEX_RAWST_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_121_RAWST, BERRY_ID_RAWST, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_121_CHESTO, INDEX_CHESTO_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_121_CHESTO, BERRY_ID_CHESTO, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_121_NANAB_1, INDEX_NANAB_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_121_NANAB_1, BERRY_ID_NANAB, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_121_NANAB_2, INDEX_NANAB_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_121_NANAB_2, BERRY_ID_NANAB, BERRY_STAGE_BERRIES
@ Route 123 @ Route 123
setberrytree BERRY_TREE_ROUTE_123_LEPPA_1, INDEX_LEPPA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_LEPPA_1, BERRY_ID_LEPPA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_LEPPA_2, INDEX_LEPPA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_LEPPA_2, BERRY_ID_LEPPA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_POMEG_3, INDEX_POMEG_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_POMEG_3, BERRY_ID_POMEG, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_POMEG_4, INDEX_POMEG_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_POMEG_4, BERRY_ID_POMEG, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_GREPA_1, INDEX_GREPA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_GREPA_1, BERRY_ID_GREPA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_GREPA_2, INDEX_GREPA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_GREPA_2, BERRY_ID_GREPA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_QUALOT_4, INDEX_QUALOT_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_QUALOT_4, BERRY_ID_QUALOT, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_QUALOT_1, INDEX_QUALOT_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_QUALOT_1, BERRY_ID_QUALOT, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_POMEG_1, INDEX_POMEG_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_POMEG_1, BERRY_ID_POMEG, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_POMEG_2, INDEX_POMEG_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_POMEG_2, BERRY_ID_POMEG, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_GREPA_3, INDEX_GREPA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_GREPA_3, BERRY_ID_GREPA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_GREPA_4, INDEX_GREPA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_GREPA_4, BERRY_ID_GREPA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_QUALOT_2, INDEX_QUALOT_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_QUALOT_2, BERRY_ID_QUALOT, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_QUALOT_3, INDEX_QUALOT_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_QUALOT_3, BERRY_ID_QUALOT, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_PECHA, INDEX_PECHA_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_PECHA, BERRY_ID_PECHA, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_SITRUS, INDEX_SITRUS_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_SITRUS, BERRY_ID_SITRUS, BERRY_STAGE_BERRIES
setberrytree BERRY_TREE_ROUTE_123_RAWST, INDEX_RAWST_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_123_RAWST, BERRY_ID_RAWST, BERRY_STAGE_BERRIES
@ Mirage Island @ Mirage Island
setberrytree BERRY_TREE_ROUTE_130_LIECHI, INDEX_LIECHI_BERRY, BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_130_LIECHI, BERRY_ID_LIECHI, BERRY_STAGE_BERRIES
return return
EventScript_ResetAllMapFlags:: EventScript_ResetAllMapFlags::

View File

@ -3,14 +3,14 @@
void SetEnigmaBerry(u8 *src); void SetEnigmaBerry(u8 *src);
bool32 IsEnigmaBerryValid(void); bool32 IsEnigmaBerryValid(void);
const struct BerryInfo *GetBerryInfo(enum BerryIndex berry); const struct BerryInfo *GetBerryInfo(enum BerryId berry);
struct BerryTree *GetBerryTreeInfo(u8 id); struct BerryTree *GetBerryTreeInfo(u8 id);
bool32 ObjectEventInteractionWaterBerryTree(void); bool32 ObjectEventInteractionWaterBerryTree(void);
bool8 IsPlayerFacingEmptyBerryTreePatch(void); bool8 IsPlayerFacingEmptyBerryTreePatch(void);
bool8 TryToWaterBerryTree(void); bool8 TryToWaterBerryTree(void);
void ClearBerryTrees(void); void ClearBerryTrees(void);
void BerryTreeTimeUpdate(s32 minutes); void BerryTreeTimeUpdate(s32 minutes);
void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 allowGrowth); void PlantBerryTree(u8 id, enum BerryId berry, u8 stage, bool8 allowGrowth);
void RemoveBerryTree(u8 id); void RemoveBerryTree(u8 id);
u8 GetBerryTypeByBerryTreeId(u8 id); u8 GetBerryTypeByBerryTreeId(u8 id);
u8 GetStageByBerryTreeId(u8 id); u8 GetStageByBerryTreeId(u8 id);

View File

@ -1070,17 +1070,17 @@ enum __attribute__((packed)) Item
#define CONFUSE_BERRY_HP_FRACTION ((B_CONFUSE_BERRIES_HEAL >= GEN_7) ? 4 : 2) #define CONFUSE_BERRY_HP_FRACTION ((B_CONFUSE_BERRIES_HEAL >= GEN_7) ? 4 : 2)
#define UNPACK_BERRY_INDEX(_berry) INDEX_##_berry##_BERRY, #define UNPACK_BERRY_ID(_berry) BERRY_ID_##_berry,
enum BerryIndex enum BerryId
{ {
INDEX_BERRY_NONE, BERRY_ID_NONE,
FOREACH_BERRY(UNPACK_BERRY_INDEX) FOREACH_BERRY(UNPACK_BERRY_ID)
INDEX_ENIGMA_BERRY_E_READER, BERRY_ID_ENGIMA_E_READER,
NUM_BERRIES = INDEX_ENIGMA_BERRY_E_READER, NUM_BERRIES = BERRY_ID_ENGIMA_E_READER,
}; };
#undef UNPACK_BERRY_INDEX #undef UNPACK_BERRY_ID
#define ITEM_TO_MAIL(itemId) ((itemId) - FIRST_MAIL_INDEX) #define ITEM_TO_MAIL(itemId) ((itemId) - FIRST_MAIL_INDEX)
#define MAIL_NONE 0xFF #define MAIL_NONE 0xFF

View File

@ -180,34 +180,34 @@ static inline enum Move GetTMHMMoveId(enum TMHMIndex index)
return gTMHMItemMoveIds[index].moveId; return gTMHMItemMoveIds[index].moveId;
} }
#define GET_BERRY_INDEX(_berry) case ITEM_##_berry##_BERRY: return INDEX_##_berry##_BERRY; #define GET_BERRY_ID(_berry) case ITEM_##_berry##_BERRY: return BERRY_ID_##_berry;
#define GET_BERRY_ITEM_ID(_berry) case INDEX_##_berry##_BERRY: return ITEM_##_berry##_BERRY; #define GET_BERRY_ITEM_ID(_berry) case BERRY_ID_##_berry: return ITEM_##_berry##_BERRY;
static inline enum BerryIndex ItemIdToBerryType(enum Item itemId) static inline enum BerryId ItemIdToBerryType(enum Item itemId)
{ {
switch (itemId) switch (itemId)
{ {
FOREACH_BERRY(GET_BERRY_INDEX) FOREACH_BERRY(GET_BERRY_ID)
case ITEM_ENIGMA_BERRY_E_READER: case ITEM_ENIGMA_BERRY_E_READER:
return INDEX_ENIGMA_BERRY_E_READER; return BERRY_ID_ENGIMA_E_READER;
default: default:
return INDEX_BERRY_NONE; return BERRY_ID_NONE;
} }
}; };
static inline enum Item BerryTypeToItemId(enum BerryIndex berryIndex) static inline enum Item BerryTypeToItemId(enum BerryId berryId)
{ {
switch (berryIndex) switch (berryId)
{ {
FOREACH_BERRY(GET_BERRY_ITEM_ID) FOREACH_BERRY(GET_BERRY_ITEM_ID)
case INDEX_ENIGMA_BERRY_E_READER: case BERRY_ID_ENGIMA_E_READER:
return ITEM_ENIGMA_BERRY_E_READER; return ITEM_ENIGMA_BERRY_E_READER;
default: default:
return ITEM_NONE; return ITEM_NONE;
} }
}; };
#undef GET_BERRY_INDEX #undef GET_BERRY_ID
#undef GET_BERRY_ITEM_ID #undef GET_BERRY_ITEM_ID
void BagPocket_SetSlotData(struct BagPocket *pocket, u32 pocketPos, struct ItemSlot newSlot); void BagPocket_SetSlotData(struct BagPocket *pocket, u32 pocketPos, struct ItemSlot newSlot);

View File

@ -695,7 +695,7 @@ static void SetPlayerBerryDataInBattleStruct(void)
} }
else else
{ {
const struct BerryInfo *berryInfo = GetBerryInfo(INDEX_ENIGMA_BERRY_E_READER); const struct BerryInfo *berryInfo = GetBerryInfo(BERRY_ID_ENGIMA_E_READER);
for (i = 0; i < BERRY_NAME_LENGTH; i++) for (i = 0; i < BERRY_NAME_LENGTH; i++)
battleBerry->name[i] = berryInfo->name[i]; battleBerry->name[i] = berryInfo->name[i];
@ -740,7 +740,7 @@ static void SetAllPlayersBerryData(void)
} }
else else
{ {
const struct BerryInfo *berryInfo = GetBerryInfo(INDEX_ENIGMA_BERRY_E_READER); const struct BerryInfo *berryInfo = GetBerryInfo(BERRY_ID_ENGIMA_E_READER);
for (i = 0; i < BERRY_NAME_LENGTH; i++) for (i = 0; i < BERRY_NAME_LENGTH; i++)
{ {

View File

@ -2894,8 +2894,8 @@ void SetMoveEffect(enum BattlerId battlerAtk, enum BattlerId effectBattler, enum
} }
break; break;
case MOVE_EFFECT_INCINERATE: case MOVE_EFFECT_INCINERATE:
if ((gItemsInfo[gBattleMons[gEffectBattler].item].pocket == POCKET_BERRIES if ((gItemsInfo[gBattleMons[effectBattler].item].pocket == POCKET_BERRIES
|| (B_INCINERATE_GEMS >= GEN_6 && GetBattlerHoldEffect(gEffectBattler) == HOLD_EFFECT_GEMS)) || (B_INCINERATE_GEMS >= GEN_6 && GetBattlerHoldEffect(effectBattler) == HOLD_EFFECT_GEMS))
&& abilities[effectBattler] != ABILITY_STICKY_HOLD) && abilities[effectBattler] != ABILITY_STICKY_HOLD)
{ {
gLastUsedItem = gBattleMons[effectBattler].item; gLastUsedItem = gBattleMons[effectBattler].item;

View File

@ -58,7 +58,7 @@ static void AddTreeBonus(struct BerryTree *tree, u8 bonus);
const struct Berry gBerries[NUM_BERRIES + 1] = const struct Berry gBerries[NUM_BERRIES + 1] =
{ {
[INDEX_BERRY_NONE] = { [BERRY_ID_NONE] = {
.info = { .info = {
.name = _("?????"), .name = _("?????"),
.description1 = COMPOUND_STRING("????????"), .description1 = COMPOUND_STRING("????????"),
@ -69,7 +69,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePicTable = gPicTable_DurinBerryTree, .berryTreePicTable = gPicTable_DurinBerryTree,
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Durin, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Durin,
}, },
[INDEX_CHERI_BERRY] = [BERRY_ID_CHERI] =
{ {
.info = { .info = {
.name = _("Cheri"), .name = _("Cheri"),
@ -102,7 +102,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Cheri, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Cheri,
}, },
[INDEX_CHESTO_BERRY] = [BERRY_ID_CHESTO] =
{ {
.info = { .info = {
.name = _("Chesto"), .name = _("Chesto"),
@ -135,7 +135,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Chesto, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Chesto,
}, },
[INDEX_PECHA_BERRY] = [BERRY_ID_PECHA] =
{ {
.info = { .info = {
.name = _("Pecha"), .name = _("Pecha"),
@ -168,7 +168,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Pecha, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Pecha,
}, },
[INDEX_RAWST_BERRY] = [BERRY_ID_RAWST] =
{ {
.info = { .info = {
.name = _("Rawst"), .name = _("Rawst"),
@ -201,7 +201,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Rawst, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Rawst,
}, },
[INDEX_ASPEAR_BERRY] = [BERRY_ID_ASPEAR] =
{ {
.info = { .info = {
.name = _("Aspear"), .name = _("Aspear"),
@ -234,7 +234,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Aspear, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Aspear,
}, },
[INDEX_LEPPA_BERRY] = [BERRY_ID_LEPPA] =
{ {
.info = { .info = {
.name = _("Leppa"), .name = _("Leppa"),
@ -267,7 +267,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Leppa, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Leppa,
}, },
[INDEX_ORAN_BERRY] = [BERRY_ID_ORAN] =
{ {
.info = { .info = {
.name = _("Oran"), .name = _("Oran"),
@ -300,7 +300,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Oran, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Oran,
}, },
[INDEX_PERSIM_BERRY] = [BERRY_ID_PERSIM] =
{ {
.info = { .info = {
.name = _("Persim"), .name = _("Persim"),
@ -333,7 +333,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Persim, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Persim,
}, },
[INDEX_LUM_BERRY] = [BERRY_ID_LUM] =
{ {
.info = { .info = {
.name = _("Lum"), .name = _("Lum"),
@ -366,7 +366,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Lum, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Lum,
}, },
[INDEX_SITRUS_BERRY] = [BERRY_ID_SITRUS] =
{ {
.info = { .info = {
.name = _("Sitrus"), .name = _("Sitrus"),
@ -399,7 +399,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Sitrus, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Sitrus,
}, },
[INDEX_FIGY_BERRY] = [BERRY_ID_FIGY] =
{ {
.info = { .info = {
.name = _("Figy"), .name = _("Figy"),
@ -432,7 +432,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Figy, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Figy,
}, },
[INDEX_WIKI_BERRY] = [BERRY_ID_WIKI] =
{ {
.info = { .info = {
.name = _("Wiki"), .name = _("Wiki"),
@ -465,7 +465,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Wiki, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Wiki,
}, },
[INDEX_MAGO_BERRY] = [BERRY_ID_MAGO] =
{ {
.info = { .info = {
.name = _("Mago"), .name = _("Mago"),
@ -498,7 +498,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Mago, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Mago,
}, },
[INDEX_AGUAV_BERRY] = [BERRY_ID_AGUAV] =
{ {
.info = { .info = {
.name = _("Aguav"), .name = _("Aguav"),
@ -531,7 +531,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Aguav, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Aguav,
}, },
[INDEX_IAPAPA_BERRY] = [BERRY_ID_IAPAPA] =
{ {
.info = { .info = {
.name = _("Iapapa"), .name = _("Iapapa"),
@ -564,7 +564,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Iapapa, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Iapapa,
}, },
[INDEX_RAZZ_BERRY] = [BERRY_ID_RAZZ] =
{ {
.info = { .info = {
.name = _("Razz"), .name = _("Razz"),
@ -597,7 +597,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Razz, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Razz,
}, },
[INDEX_BLUK_BERRY] = [BERRY_ID_BLUK] =
{ {
.info = { .info = {
.name = _("Bluk"), .name = _("Bluk"),
@ -630,7 +630,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Razz, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Razz,
}, },
[INDEX_NANAB_BERRY] = [BERRY_ID_NANAB] =
{ {
.info = { .info = {
.name = _("Nanab"), .name = _("Nanab"),
@ -663,7 +663,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Mago, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Mago,
}, },
[INDEX_WEPEAR_BERRY] = [BERRY_ID_WEPEAR] =
{ {
.info = { .info = {
.name = _("Wepear"), .name = _("Wepear"),
@ -696,7 +696,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Wepear, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Wepear,
}, },
[INDEX_PINAP_BERRY] = [BERRY_ID_PINAP] =
{ {
.info = { .info = {
.name = _("Pinap"), .name = _("Pinap"),
@ -729,7 +729,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Iapapa, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Iapapa,
}, },
[INDEX_POMEG_BERRY] = [BERRY_ID_POMEG] =
{ {
.info = { .info = {
.name = _("Pomeg"), .name = _("Pomeg"),
@ -762,7 +762,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Pomeg, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Pomeg,
}, },
[INDEX_KELPSY_BERRY] = [BERRY_ID_KELPSY] =
{ {
.info = { .info = {
.name = _("Kelpsy"), .name = _("Kelpsy"),
@ -795,7 +795,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Kelpsy, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Kelpsy,
}, },
[INDEX_QUALOT_BERRY] = [BERRY_ID_QUALOT] =
{ {
.info = { .info = {
.name = _("Qualot"), .name = _("Qualot"),
@ -828,7 +828,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Wepear, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Wepear,
}, },
[INDEX_HONDEW_BERRY] = [BERRY_ID_HONDEW] =
{ {
.info = { .info = {
.name = _("Hondew"), .name = _("Hondew"),
@ -861,7 +861,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Hondew, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Hondew,
}, },
[INDEX_GREPA_BERRY] = [BERRY_ID_GREPA] =
{ {
.info = { .info = {
.name = _("Grepa"), .name = _("Grepa"),
@ -894,7 +894,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Grepa, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Grepa,
}, },
[INDEX_TAMATO_BERRY] = [BERRY_ID_TAMATO] =
{ {
.info = { .info = {
.name = _("Tamato"), .name = _("Tamato"),
@ -927,7 +927,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Tamato, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Tamato,
}, },
[INDEX_CORNN_BERRY] = [BERRY_ID_CORNN] =
{ {
.info = { .info = {
.name = _("Cornn"), .name = _("Cornn"),
@ -960,7 +960,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Cornn, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Cornn,
}, },
[INDEX_MAGOST_BERRY] = [BERRY_ID_MAGOST] =
{ {
.info = { .info = {
.name = _("Magost"), .name = _("Magost"),
@ -993,7 +993,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Pomeg, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Pomeg,
}, },
[INDEX_RABUTA_BERRY] = [BERRY_ID_RABUTA] =
{ {
.info = { .info = {
.name = _("Rabuta"), .name = _("Rabuta"),
@ -1026,7 +1026,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Rabuta, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Rabuta,
}, },
[INDEX_NOMEL_BERRY] = [BERRY_ID_NOMEL] =
{ {
.info = { .info = {
.name = _("Nomel"), .name = _("Nomel"),
@ -1059,7 +1059,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Nomel, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Nomel,
}, },
[INDEX_SPELON_BERRY] = [BERRY_ID_SPELON] =
{ {
.info = { .info = {
.name = _("Spelon"), .name = _("Spelon"),
@ -1092,7 +1092,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Spelon, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Spelon,
}, },
[INDEX_PAMTRE_BERRY] = [BERRY_ID_PAMTRE] =
{ {
.info = { .info = {
.name = _("Pamtre"), .name = _("Pamtre"),
@ -1125,7 +1125,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Pamtre, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Pamtre,
}, },
[INDEX_WATMEL_BERRY] = [BERRY_ID_WATMEL] =
{ {
.info = { .info = {
.name = _("Watmel"), .name = _("Watmel"),
@ -1158,7 +1158,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Rabuta, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Rabuta,
}, },
[INDEX_DURIN_BERRY] = [BERRY_ID_DURIN] =
{ {
.info = { .info = {
.name = _("Durin"), .name = _("Durin"),
@ -1191,7 +1191,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Durin, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Durin,
}, },
[INDEX_BELUE_BERRY] = [BERRY_ID_BELUE] =
{ {
.info = { .info = {
.name = _("Belue"), .name = _("Belue"),
@ -1224,7 +1224,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Hondew, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Hondew,
}, },
[INDEX_OCCA_BERRY] = [BERRY_ID_OCCA] =
{ {
.info = { .info = {
.name = _("Occa"), .name = _("Occa"),
@ -1257,7 +1257,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Occa, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Occa,
}, },
[INDEX_PASSHO_BERRY] = [BERRY_ID_PASSHO] =
{ {
.info = { .info = {
.name = _("Passho"), .name = _("Passho"),
@ -1290,7 +1290,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Cornn, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Cornn,
}, },
[INDEX_WACAN_BERRY] = [BERRY_ID_WACAN] =
{ {
.info = { .info = {
.name = _("Wacan"), .name = _("Wacan"),
@ -1323,7 +1323,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Razz, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Razz,
}, },
[INDEX_RINDO_BERRY] = [BERRY_ID_RINDO] =
{ {
.info = { .info = {
.name = _("Rindo"), .name = _("Rindo"),
@ -1356,7 +1356,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Tamato, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Tamato,
}, },
[INDEX_YACHE_BERRY] = [BERRY_ID_YACHE] =
{ {
.info = { .info = {
.name = _("Yache"), .name = _("Yache"),
@ -1389,7 +1389,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Yache, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Yache,
}, },
[INDEX_CHOPLE_BERRY] = [BERRY_ID_CHOPLE] =
{ {
.info = { .info = {
.name = _("Chople"), .name = _("Chople"),
@ -1422,7 +1422,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Chople, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Chople,
}, },
[INDEX_KEBIA_BERRY] = [BERRY_ID_KEBIA] =
{ {
.info = { .info = {
.name = _("Kebia"), .name = _("Kebia"),
@ -1455,7 +1455,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Kebia, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Kebia,
}, },
[INDEX_SHUCA_BERRY] = [BERRY_ID_SHUCA] =
{ {
.info = { .info = {
.name = _("Shuca"), .name = _("Shuca"),
@ -1488,7 +1488,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Shuca, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Shuca,
}, },
[INDEX_COBA_BERRY] = [BERRY_ID_COBA] =
{ {
.info = { .info = {
.name = _("Coba"), .name = _("Coba"),
@ -1521,7 +1521,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Rawst, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Rawst,
}, },
[INDEX_PAYAPA_BERRY] = [BERRY_ID_PAYAPA] =
{ {
.info = { .info = {
.name = _("Payapa"), .name = _("Payapa"),
@ -1554,7 +1554,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Payapa, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Payapa,
}, },
[INDEX_TANGA_BERRY] = [BERRY_ID_TANGA] =
{ {
.info = { .info = {
.name = _("Tanga"), .name = _("Tanga"),
@ -1587,7 +1587,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Tanga, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Tanga,
}, },
[INDEX_CHARTI_BERRY] = [BERRY_ID_CHARTI] =
{ {
.info = { .info = {
.name = _("Charti"), .name = _("Charti"),
@ -1620,7 +1620,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Lansat, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Lansat,
}, },
[INDEX_KASIB_BERRY] = [BERRY_ID_KASIB] =
{ {
.info = { .info = {
.name = _("Kasib"), .name = _("Kasib"),
@ -1653,7 +1653,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Kasib, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Kasib,
}, },
[INDEX_HABAN_BERRY] = [BERRY_ID_HABAN] =
{ {
.info = { .info = {
.name = _("Haban"), .name = _("Haban"),
@ -1686,7 +1686,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Haban, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Haban,
}, },
[INDEX_COLBUR_BERRY] = [BERRY_ID_COLBUR] =
{ {
.info = { .info = {
.name = _("Colbur"), .name = _("Colbur"),
@ -1719,7 +1719,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Colbur, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Colbur,
}, },
[INDEX_BABIRI_BERRY] = [BERRY_ID_BABIRI] =
{ {
.info = { .info = {
.name = _("Babiri"), .name = _("Babiri"),
@ -1752,7 +1752,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Liechi, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Liechi,
}, },
[INDEX_CHILAN_BERRY] = [BERRY_ID_CHILAN] =
{ {
.info = { .info = {
.name = _("Chilan"), .name = _("Chilan"),
@ -1785,7 +1785,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Grepa, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Grepa,
}, },
[INDEX_LIECHI_BERRY] = [BERRY_ID_LIECHI] =
{ {
.info = { .info = {
.name = _("Liechi"), .name = _("Liechi"),
@ -1818,7 +1818,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Liechi, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Liechi,
}, },
[INDEX_GANLON_BERRY] = [BERRY_ID_GANLON] =
{ {
.info = { .info = {
.name = _("Ganlon"), .name = _("Ganlon"),
@ -1851,7 +1851,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Hondew, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Hondew,
}, },
[INDEX_SALAC_BERRY] = [BERRY_ID_SALAC] =
{ {
.info = { .info = {
.name = _("Salac"), .name = _("Salac"),
@ -1884,7 +1884,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Aguav, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Aguav,
}, },
[INDEX_PETAYA_BERRY] = [BERRY_ID_PETAYA] =
{ {
.info = { .info = {
.name = _("Petaya"), .name = _("Petaya"),
@ -1917,7 +1917,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Pomeg, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Pomeg,
}, },
[INDEX_APICOT_BERRY] = [BERRY_ID_APICOT] =
{ {
.info = { .info = {
.name = _("Apicot"), .name = _("Apicot"),
@ -1950,7 +1950,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Grepa, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Grepa,
}, },
[INDEX_LANSAT_BERRY] = [BERRY_ID_LANSAT] =
{ {
.info = { .info = {
.name = _("Lansat"), .name = _("Lansat"),
@ -1983,7 +1983,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Lansat, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Lansat,
}, },
[INDEX_STARF_BERRY] = [BERRY_ID_STARF] =
{ {
.info = { .info = {
.name = _("Starf"), .name = _("Starf"),
@ -2016,7 +2016,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Cornn, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Cornn,
}, },
[INDEX_ENIGMA_BERRY] = [BERRY_ID_ENIGMA] =
{ {
.info = { .info = {
.name = _("Enigma"), .name = _("Enigma"),
@ -2049,7 +2049,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Durin, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Durin,
}, },
[INDEX_MICLE_BERRY] = [BERRY_ID_MICLE] =
{ {
.info = { .info = {
.name = _("Micle"), .name = _("Micle"),
@ -2082,7 +2082,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Micle, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Micle,
}, },
[INDEX_CUSTAP_BERRY] = [BERRY_ID_CUSTAP] =
{ {
.info = { .info = {
.name = _("Custap"), .name = _("Custap"),
@ -2115,7 +2115,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Custap, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Custap,
}, },
[INDEX_JABOCA_BERRY] = [BERRY_ID_JABOCA] =
{ {
.info = { .info = {
.name = _("Jaboca"), .name = _("Jaboca"),
@ -2148,7 +2148,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Jaboca, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Jaboca,
}, },
[INDEX_ROWAP_BERRY] = [BERRY_ID_ROWAP] =
{ {
.info = { .info = {
.name = _("Rowap"), .name = _("Rowap"),
@ -2181,7 +2181,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Rowap, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Rowap,
}, },
[INDEX_ROSELI_BERRY] = [BERRY_ID_ROSELI] =
{ {
.info = { .info = {
.name = _("Roseli"), .name = _("Roseli"),
@ -2214,7 +2214,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Roseli, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Roseli,
}, },
[INDEX_KEE_BERRY] = [BERRY_ID_KEE] =
{ {
.info = { .info = {
.name = _("Kee"), .name = _("Kee"),
@ -2247,7 +2247,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Pecha, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Pecha,
}, },
[INDEX_MARANGA_BERRY] = [BERRY_ID_MARANGA] =
{ {
.info = { .info = {
.name = _("Marnga"), // "Maranga" is too long .name = _("Marnga"), // "Maranga" is too long
@ -2280,7 +2280,7 @@ const struct Berry gBerries[NUM_BERRIES + 1] =
.berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Occa, .berryTreePaletteSlotTable = gBerryTreePaletteSlotTable_Occa,
}, },
[INDEX_ENIGMA_BERRY_E_READER] = [BERRY_ID_ENGIMA_E_READER] =
{ {
.info = { .info = {
.name = _("Enigma"), .name = _("Enigma"),
@ -2356,19 +2356,19 @@ bool32 IsEnigmaBerryValid(void)
#endif //FREE_ENIGMA_BERRY #endif //FREE_ENIGMA_BERRY
} }
const struct BerryInfo *GetBerryInfo(enum BerryIndex berry) const struct BerryInfo *GetBerryInfo(enum BerryId berry)
{ {
if (berry == INDEX_ENIGMA_BERRY_E_READER && IsEnigmaBerryValid()) if (berry == BERRY_ID_ENGIMA_E_READER && IsEnigmaBerryValid())
{ {
#if FREE_ENIGMA_BERRY == FALSE #if FREE_ENIGMA_BERRY == FALSE
return (struct BerryInfo *)(&gSaveBlock1Ptr->enigmaBerry.berry); return (struct BerryInfo *)(&gSaveBlock1Ptr->enigmaBerry.berry);
#else #else
return &gBerries[INDEX_BERRY_NONE].info; //never reached, but will appease the compiler gods return &gBerries[BERRY_ID_NONE].info; //never reached, but will appease the compiler gods
#endif //FREE_ENIGMA_BERRY #endif //FREE_ENIGMA_BERRY
} }
else else
{ {
if (berry == INDEX_BERRY_NONE || berry > NUM_BERRIES) if (berry == BERRY_ID_NONE || berry > NUM_BERRIES)
berry = 1; berry = 1;
return &gBerries[berry].info; return &gBerries[berry].info;
} }
@ -2575,7 +2575,7 @@ void BerryTreeTimeUpdate(s32 minutes)
} }
} }
void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 allowGrowth) void PlantBerryTree(u8 id, enum BerryId berry, u8 stage, bool8 allowGrowth)
{ {
struct BerryTree *tree = GetBerryTreeInfo(id); struct BerryTree *tree = GetBerryTreeInfo(id);
@ -2947,20 +2947,20 @@ bool8 PlayerHasMulch(void)
#if OW_BERRY_MUTATIONS == TRUE #if OW_BERRY_MUTATIONS == TRUE
static const u8 sBerryMutations[][3] = { static const u8 sBerryMutations[][3] = {
{INDEX_IAPAPA_BERRY, INDEX_MAGO_BERRY, INDEX_POMEG_BERRY}, {BERRY_ID_IAPAPA, BERRY_ID_MAGO, BERRY_ID_POMEG},
{INDEX_CHESTO_BERRY, INDEX_PERSIM_BERRY, INDEX_KELPSY_BERRY}, {BERRY_ID_CHESTO, BERRY_ID_PERSIM, BERRY_ID_KELPSY},
{INDEX_ORAN_BERRY, INDEX_PECHA_BERRY, INDEX_QUALOT_BERRY}, {BERRY_ID_ORAN, BERRY_ID_PECHA, BERRY_ID_QUALOT},
{INDEX_CHESTO_BERRY, INDEX_PERSIM_BERRY, INDEX_KELPSY_BERRY}, {BERRY_ID_CHESTO, BERRY_ID_PERSIM, BERRY_ID_KELPSY},
{INDEX_ASPEAR_BERRY, INDEX_LEPPA_BERRY, INDEX_HONDEW_BERRY}, {BERRY_ID_ASPEAR, BERRY_ID_LEPPA, BERRY_ID_HONDEW},
{INDEX_AGUAV_BERRY, INDEX_FIGY_BERRY, INDEX_GREPA_BERRY}, {BERRY_ID_AGUAV, BERRY_ID_FIGY, BERRY_ID_GREPA},
{INDEX_LUM_BERRY, INDEX_SITRUS_BERRY, INDEX_TAMATO_BERRY}, {BERRY_ID_LUM, BERRY_ID_SITRUS, BERRY_ID_TAMATO},
{INDEX_HONDEW_BERRY, INDEX_YACHE_BERRY, INDEX_LIECHI_BERRY}, {BERRY_ID_HONDEW, BERRY_ID_YACHE, BERRY_ID_LIECHI},
{INDEX_QUALOT_BERRY, INDEX_TANGA_BERRY, INDEX_GANLON_BERRY}, {BERRY_ID_QUALOT, BERRY_ID_TANGA, BERRY_ID_GANLON},
{INDEX_GREPA_BERRY, INDEX_ROSELI_BERRY, INDEX_SALAC_BERRY}, {BERRY_ID_GREPA, BERRY_ID_ROSELI, BERRY_ID_SALAC},
{INDEX_POMEG_BERRY, INDEX_KASIB_BERRY, INDEX_PETAYA_BERRY}, {BERRY_ID_POMEG, BERRY_ID_KASIB, BERRY_ID_PETAYA},
{INDEX_KELPSY_BERRY, INDEX_WACAN_BERRY, INDEX_APICOT_BERRY}, {BERRY_ID_KELPSY, BERRY_ID_WACAN, BERRY_ID_APICOT},
{INDEX_GANLON_BERRY, INDEX_LIECHI_BERRY, INDEX_KEE_BERRY}, {BERRY_ID_GANLON, BERRY_ID_LIECHI, BERRY_ID_KEE},
{INDEX_SALAC_BERRY, INDEX_PETAYA_BERRY, INDEX_MARANGA_BERRY}, {BERRY_ID_SALAC, BERRY_ID_PETAYA, BERRY_ID_MARANGA},
// Up to one more Mutation can be added here for a total of 15 (only 4 bits are allocated) // Up to one more Mutation can be added here for a total of 15 (only 4 bits are allocated)
}; };

View File

@ -104,7 +104,7 @@ enum {
#define PALTAG_MISC 46546 #define PALTAG_MISC 46546
// Last berry that an NPC can put in // Last berry that an NPC can put in
#define NUM_NPC_BERRIES INDEX_ASPEAR_BERRY #define NUM_NPC_BERRIES BERRY_ID_ASPEAR
enum { enum {
// Windows 0-3 are used implicitly in several loops over BLENDER_MAX_PLAYERS // Windows 0-3 are used implicitly in several loops over BLENDER_MAX_PLAYERS
@ -848,28 +848,28 @@ static const s16 sBerrySpriteData[][5] =
static const u8 sOpponentBerrySets[][3] = static const u8 sOpponentBerrySets[][3] =
{ {
// These sets are used if the player chose one of the 5 NPC berries // These sets are used if the player chose one of the 5 NPC berries
{INDEX_ASPEAR_BERRY, INDEX_RAWST_BERRY, INDEX_PECHA_BERRY}, // player chose Cheri Berry {BERRY_ID_ASPEAR, BERRY_ID_RAWST, BERRY_ID_PECHA}, // player chose Cheri Berry
{INDEX_CHERI_BERRY, INDEX_ASPEAR_BERRY, INDEX_RAWST_BERRY}, // player chose Chesto Berry {BERRY_ID_CHERI, BERRY_ID_ASPEAR, BERRY_ID_RAWST}, // player chose Chesto Berry
{INDEX_CHESTO_BERRY, INDEX_CHERI_BERRY, INDEX_ASPEAR_BERRY}, // player chose Pecha Berry {BERRY_ID_CHESTO, BERRY_ID_CHERI, BERRY_ID_ASPEAR}, // player chose Pecha Berry
{INDEX_PECHA_BERRY, INDEX_CHESTO_BERRY, INDEX_CHERI_BERRY}, // player chose Rawst Berry {BERRY_ID_PECHA, BERRY_ID_CHESTO, BERRY_ID_CHERI}, // player chose Rawst Berry
{INDEX_RAWST_BERRY, INDEX_PECHA_BERRY, INDEX_CHESTO_BERRY}, // player chose Aspear Berry {BERRY_ID_RAWST, BERRY_ID_PECHA, BERRY_ID_CHESTO}, // player chose Aspear Berry
// These sets are used if the player chose a different berry (set is selected by player's berry % 5) // These sets are used if the player chose a different berry (set is selected by player's berry % 5)
{INDEX_CHERI_BERRY, INDEX_PECHA_BERRY, INDEX_RAWST_BERRY}, // player chose Leppa, Figy, ... {BERRY_ID_CHERI, BERRY_ID_PECHA, BERRY_ID_RAWST}, // player chose Leppa, Figy, ...
{INDEX_CHESTO_BERRY, INDEX_RAWST_BERRY, INDEX_ASPEAR_BERRY}, // player chose Oran, Wiki, ... {BERRY_ID_CHESTO, BERRY_ID_RAWST, BERRY_ID_ASPEAR}, // player chose Oran, Wiki, ...
{INDEX_PECHA_BERRY, INDEX_ASPEAR_BERRY, INDEX_CHERI_BERRY}, // player chose Persim, Mago, ... {BERRY_ID_PECHA, BERRY_ID_ASPEAR, BERRY_ID_CHERI}, // player chose Persim, Mago, ...
{INDEX_RAWST_BERRY, INDEX_CHERI_BERRY, INDEX_CHESTO_BERRY}, // player chose Lum, Aguav, ... {BERRY_ID_RAWST, BERRY_ID_CHERI, BERRY_ID_CHESTO}, // player chose Lum, Aguav, ...
{INDEX_ASPEAR_BERRY, INDEX_CHESTO_BERRY, INDEX_PECHA_BERRY}, // player chose Sitrus, Iapapa, ... {BERRY_ID_ASPEAR, BERRY_ID_CHESTO, BERRY_ID_PECHA}, // player chose Sitrus, Iapapa, ...
}; };
// Berry master's berries follow the same rules as above, but instead of explicitly listing // Berry master's berries follow the same rules as above, but instead of explicitly listing
// the alternate sets if the player chooses one of these berries, it implicitly uses these berries - 5, i.e. Tamato - Nomel // the alternate sets if the player chooses one of these berries, it implicitly uses these berries - 5, i.e. Tamato - Nomel
static const u8 sBerryMasterBerries[] = { static const u8 sBerryMasterBerries[] = {
INDEX_SPELON_BERRY, BERRY_ID_SPELON,
INDEX_PAMTRE_BERRY, BERRY_ID_PAMTRE,
INDEX_WATMEL_BERRY, BERRY_ID_WATMEL,
INDEX_DURIN_BERRY, BERRY_ID_DURIN,
INDEX_BELUE_BERRY BERRY_ID_BELUE
}; };
// "0 players" is link // "0 players" is link
@ -1185,7 +1185,7 @@ static void SetBerrySpriteData(struct Sprite *sprite, s32 x, s32 y, s32 bounceSp
static void CreateBerrySprite(enum Item itemId, u32 playerId) static void CreateBerrySprite(enum Item itemId, u32 playerId)
{ {
enum BerryIndex berryId = ItemIdToBerryType(itemId); enum BerryId berryId = ItemIdToBerryType(itemId);
u32 spriteId = CreateSpinningBerrySprite(berryId, 0, 80, playerId & 1); u32 spriteId = CreateSpinningBerrySprite(berryId, 0, 80, playerId & 1);
SetBerrySpriteData(&gSprites[spriteId], SetBerrySpriteData(&gSprites[spriteId],
sBerrySpriteData[playerId][0], sBerrySpriteData[playerId][0],
@ -1553,7 +1553,7 @@ static void SetOpponentsBerryData(u16 playerBerryItemId, u8 playersNum, struct B
for (i = 0; i < playersNum - 1; i++) for (i = 0; i < playersNum - 1; i++)
{ {
opponentBerryId = sOpponentBerrySets[opponentSetId][i]; opponentBerryId = sOpponentBerrySets[opponentSetId][i];
berryMasterDiff = ItemIdToBerryType(playerBerryItemId) - INDEX_SPELON_BERRY; berryMasterDiff = ItemIdToBerryType(playerBerryItemId) - BERRY_ID_SPELON;
if (!FlagGet(FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER) && gSpecialVar_0x8004 == 1) if (!FlagGet(FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER) && gSpecialVar_0x8004 == 1)
{ {
opponentSetId %= ARRAY_COUNT(sBerryMasterBerries); opponentSetId %= ARRAY_COUNT(sBerryMasterBerries);

View File

@ -1024,7 +1024,7 @@ void StartBerryCrush(MainCallback exitCallback)
static void GetBerryFromBag(void) static void GetBerryFromBag(void)
{ {
enum BerryIndex berryId = ItemIdToBerryType(gSpecialVar_ItemId); enum BerryId berryId = ItemIdToBerryType(gSpecialVar_ItemId);
if (!berryId) if (!berryId)
{ {
berryId = 1; berryId = 1;

View File

@ -3853,9 +3853,9 @@ static void DebugAction_PCBag_Fill_PocketBerries(u8 taskId)
{ {
enum Item itemId; enum Item itemId;
for (enum BerryIndex berryIndex = 1; berryIndex < NUM_BERRIES; berryIndex++) for (enum BerryId berryId = 1; berryId < NUM_BERRIES; berryId++)
{ {
itemId = BerryTypeToItemId(berryIndex); itemId = BerryTypeToItemId(berryId);
if (CheckBagHasSpace(itemId, MAX_BAG_ITEM_CAPACITY)) if (CheckBagHasSpace(itemId, MAX_BAG_ITEM_CAPACITY))
AddBagItem(itemId, MAX_BAG_ITEM_CAPACITY); AddBagItem(itemId, MAX_BAG_ITEM_CAPACITY);
} }

View File

@ -592,40 +592,40 @@ ALIGNED(4)
static const u8 sPrizeBerryIds[][10] = static const u8 sPrizeBerryIds[][10] =
{ {
{ // Possible prizes with 3 players { // Possible prizes with 3 players
INDEX_RAZZ_BERRY, BERRY_ID_RAZZ,
INDEX_BLUK_BERRY, BERRY_ID_BLUK,
INDEX_NANAB_BERRY, BERRY_ID_NANAB,
INDEX_WEPEAR_BERRY, BERRY_ID_WEPEAR,
INDEX_PINAP_BERRY, BERRY_ID_PINAP,
INDEX_PINAP_BERRY, BERRY_ID_PINAP,
INDEX_WEPEAR_BERRY, BERRY_ID_WEPEAR,
INDEX_NANAB_BERRY, BERRY_ID_NANAB,
INDEX_BLUK_BERRY, BERRY_ID_BLUK,
INDEX_RAZZ_BERRY BERRY_ID_RAZZ
}, },
{ // Possible prizes with 4 players { // Possible prizes with 4 players
INDEX_POMEG_BERRY, BERRY_ID_POMEG,
INDEX_KELPSY_BERRY, BERRY_ID_KELPSY,
INDEX_QUALOT_BERRY, BERRY_ID_QUALOT,
INDEX_HONDEW_BERRY, BERRY_ID_HONDEW,
INDEX_GREPA_BERRY, BERRY_ID_GREPA,
INDEX_TAMATO_BERRY, BERRY_ID_TAMATO,
INDEX_CORNN_BERRY, BERRY_ID_CORNN,
INDEX_MAGOST_BERRY, BERRY_ID_MAGOST,
INDEX_RABUTA_BERRY, BERRY_ID_RABUTA,
INDEX_NOMEL_BERRY BERRY_ID_NOMEL
}, },
{ // Possible prizes with 5 players { // Possible prizes with 5 players
INDEX_SPELON_BERRY, BERRY_ID_SPELON,
INDEX_PAMTRE_BERRY, BERRY_ID_PAMTRE,
INDEX_WATMEL_BERRY, BERRY_ID_WATMEL,
INDEX_DURIN_BERRY, BERRY_ID_DURIN,
INDEX_BELUE_BERRY, BERRY_ID_BELUE,
INDEX_BELUE_BERRY, BERRY_ID_BELUE,
INDEX_DURIN_BERRY, BERRY_ID_DURIN,
INDEX_WATMEL_BERRY, BERRY_ID_WATMEL,
INDEX_PAMTRE_BERRY, BERRY_ID_PAMTRE,
INDEX_SPELON_BERRY BERRY_ID_SPELON
}, },
}; };

View File

@ -3187,7 +3187,7 @@ static void SetBerryTreeGraphicsById(struct ObjectEvent *objectEvent, u8 berryId
static void SetBerryTreeGraphics(struct ObjectEvent *objectEvent, struct Sprite *sprite) static void SetBerryTreeGraphics(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{ {
u8 berryStage; u8 berryStage;
enum BerryIndex berryId; enum BerryId berryId;
objectEvent->invisible = TRUE; objectEvent->invisible = TRUE;
sprite->invisible = TRUE; sprite->invisible = TRUE;

View File

@ -225,9 +225,9 @@ bool32 CheckBagHasItem(enum Item itemId, u16 count)
bool32 HasAtLeastOneBerry(void) bool32 HasAtLeastOneBerry(void)
{ {
for (enum BerryIndex berryIndex = 1; berryIndex < NUM_BERRIES; berryIndex++) for (enum BerryId berryId = 1; berryId < NUM_BERRIES; berryId++)
{ {
if (CheckBagHasItem(BerryTypeToItemId(berryIndex), 1) == TRUE) if (CheckBagHasItem(BerryTypeToItemId(berryId), 1) == TRUE)
return (gSpecialVar_Result = TRUE); return (gSpecialVar_Result = TRUE);
} }

View File

@ -2600,12 +2600,12 @@ bool8 ScrCmd_playslotmachine(struct ScriptContext *ctx)
bool8 ScrCmd_setberrytree(struct ScriptContext *ctx) bool8 ScrCmd_setberrytree(struct ScriptContext *ctx)
{ {
u8 treeId = ScriptReadByte(ctx); u8 treeId = ScriptReadByte(ctx);
enum BerryIndex berryIndex = ScriptReadByte(ctx); enum BerryId berryId = ScriptReadByte(ctx);
u8 growthStage = ScriptReadByte(ctx); u8 growthStage = ScriptReadByte(ctx);
Script_RequestEffects(SCREFF_V1 | SCREFF_SAVE); Script_RequestEffects(SCREFF_V1 | SCREFF_SAVE);
PlantBerryTree(treeId, berryIndex, growthStage, FALSE); PlantBerryTree(treeId, berryId, growthStage, FALSE);
return FALSE; return FALSE;
} }

View File

@ -108,7 +108,7 @@ bool8 DoesPartyHaveEnigmaBerry(void)
{ {
bool8 hasItem = CheckPartyMonHasHeldItem(ITEM_ENIGMA_BERRY_E_READER); bool8 hasItem = CheckPartyMonHasHeldItem(ITEM_ENIGMA_BERRY_E_READER);
if (hasItem == TRUE) if (hasItem == TRUE)
GetBerryNameByBerryType(INDEX_ENIGMA_BERRY_E_READER, gStringVar1); GetBerryNameByBerryType(BERRY_ID_ENGIMA_E_READER, gStringVar1);
return hasItem; return hasItem;
} }
@ -684,8 +684,8 @@ void Script_SetKO(struct ScriptContext *ctx)
void Script_GiveRandomBerry(struct ScriptContext *ctx) void Script_GiveRandomBerry(struct ScriptContext *ctx)
{ {
enum BerryIndex loBerry = ScriptReadByte(ctx); enum BerryId loBerry = ScriptReadByte(ctx);
enum BerryIndex hiBerry = ScriptReadByte(ctx); enum BerryId hiBerry = ScriptReadByte(ctx);
gSpecialVar_Result = BerryTypeToItemId(RandomUniform(RNG_RANDOM_BERRY, loBerry, hiBerry)); gSpecialVar_Result = BerryTypeToItemId(RandomUniform(RNG_RANDOM_BERRY, loBerry, hiBerry));
} }

View File

@ -31,11 +31,11 @@ void WonderNews_SetReward(u32 newsType)
case WONDER_NEWS_RECV_FRIEND: case WONDER_NEWS_RECV_FRIEND:
case WONDER_NEWS_RECV_WIRELESS: case WONDER_NEWS_RECV_WIRELESS:
// Random berry between ITEM_RAZZ_BERRY and ITEM_NOMEL_BERRY // Random berry between ITEM_RAZZ_BERRY and ITEM_NOMEL_BERRY
data->berry = RandomUniform(RNG_RANDOM_BERRY, INDEX_RAZZ_BERRY, INDEX_NOMEL_BERRY); data->berry = RandomUniform(RNG_RANDOM_BERRY, BERRY_ID_RAZZ, BERRY_ID_NOMEL);
break; break;
case WONDER_NEWS_SENT: case WONDER_NEWS_SENT:
// Random berry between ITEM_CHERI_BERRY and ITEM_IAPAPA_BERRY // Random berry between ITEM_CHERI_BERRY and ITEM_IAPAPA_BERRY
data->berry = RandomUniform(RNG_RANDOM_BERRY, INDEX_CHERI_BERRY, INDEX_IAPAPA_BERRY); data->berry = RandomUniform(RNG_RANDOM_BERRY, BERRY_ID_CHERI, BERRY_ID_IAPAPA);
break; break;
} }
} }