summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2020-04-27 14:19:54 -0400
committerGriffinR <griffin.g.richards@gmail.com>2020-04-27 14:19:54 -0400
commit15f5cb7e7398431ae22f24c8e8a69683a0dc24fc (patch)
tree59e6ca4c3e48a892685ffefef42b8f823868051f /src
parent7d4c9d1f9f11c60db3a0e81777cfbbbda483d2e3 (diff)
Sync new_game.inc
Diffstat (limited to 'src')
-rw-r--r--src/berry.c21
-rw-r--r--src/berry_tag_screen.c3
-rw-r--r--src/item.c2
-rw-r--r--src/new_game.c4
-rw-r--r--src/pokemon_item_effect.c2
5 files changed, 16 insertions, 16 deletions
diff --git a/src/berry.c b/src/berry.c
index f1bdb5235..590b03469 100644
--- a/src/berry.c
+++ b/src/berry.c
@@ -11,6 +11,7 @@
#include "random.h"
#include "task.h"
#include "text.h"
+#include "constants/berry.h"
#include "constants/event_object_movement.h"
#include "constants/items.h"
@@ -1127,7 +1128,7 @@ const struct Berry *GetBerryInfo(u8 berry)
// when getting the pointer to the berry info, enigma berries are handled differently. if your
// berry is an Enigma Berry and its checksum is valid, fetch the pointer to its information in
// the save block.
- if (berry == GETBERRYID(ITEM_ENIGMA_BERRY) && IsEnigmaBerryValid())
+ if (berry == ITEM_TO_BERRY(ITEM_ENIGMA_BERRY) && IsEnigmaBerryValid())
return &gSaveBlock1.enigmaBerry.berry;
else
{
@@ -1135,8 +1136,8 @@ const struct Berry *GetBerryInfo(u8 berry)
// an enigma berry whos checksum failed, the game will use the Enigma Berry information
// for this: meaning if you see the Enigma Berry information, its actually because the
// checksum failed.
- if (berry == BERRY_NONE || berry > GETBERRYID(LAST_BERRY))
- berry = GETBERRYID(FIRST_BERRY);
+ if (berry == BERRY_NONE || berry > ITEM_TO_BERRY(LAST_BERRY_INDEX))
+ berry = ITEM_TO_BERRY(FIRST_BERRY_INDEX);
return &gBerries[berry - 1];
}
}
@@ -1321,22 +1322,22 @@ u8 GetStageByBerryTreeId(u8 id)
u8 ItemIdToBerryType(u16 item)
{
- u16 berry = item - FIRST_BERRY;
+ u16 berry = item - FIRST_BERRY_INDEX;
- if (berry > LAST_BERRY - FIRST_BERRY)
- return GETBERRYID(FIRST_BERRY);
+ if (berry > LAST_BERRY_INDEX - FIRST_BERRY_INDEX)
+ return ITEM_TO_BERRY(FIRST_BERRY_INDEX);
else
- return GETBERRYID(item);
+ return ITEM_TO_BERRY(item);
}
static u16 BerryTypeToItemId(u16 berry)
{
u16 item = berry - 1;
- if (item > LAST_BERRY - FIRST_BERRY)
- return FIRST_BERRY;
+ if (item > LAST_BERRY_INDEX - FIRST_BERRY_INDEX)
+ return FIRST_BERRY_INDEX;
else
- return GETITEMID(berry);
+ return berry + FIRST_BERRY_INDEX - 1;
}
void GetBerryNameByBerryType(u8 berry, u8 *string)
diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c
index a8f797e28..2a2ff6ae2 100644
--- a/src/berry_tag_screen.c
+++ b/src/berry_tag_screen.c
@@ -20,7 +20,6 @@
#include "text.h"
#define OFFSET_7B (123)
-#define FIRST_BERRY ITEM_CHERI_BERRY
struct Struct2000000
{
@@ -277,7 +276,7 @@ static void sub_81464E4(void)
berryInfo = GetBerryInfo(gSpecialVar_ItemId + OFFSET_7B + 1);
- ConvertIntToDecimalStringN(gStringVar1, gSpecialVar_ItemId - FIRST_BERRY + 1, STR_CONV_MODE_LEADING_ZEROS, 2);
+ ConvertIntToDecimalStringN(gStringVar1, gSpecialVar_ItemId - FIRST_BERRY_INDEX + 1, STR_CONV_MODE_LEADING_ZEROS, 2);
Menu_PrintText(gStringVar1, 12, 4);
#if ENGLISH
diff --git a/src/item.c b/src/item.c
index 470b4d430..8483e6d3f 100644
--- a/src/item.c
+++ b/src/item.c
@@ -64,7 +64,7 @@ void CopyItemName(u16 itemId, u8 *string)
{
if (itemId == ITEM_ENIGMA_BERRY)
{
- StringCopy(string, GetBerryInfo(GETBERRYID(ITEM_ENIGMA_BERRY))->name);
+ StringCopy(string, GetBerryInfo(ITEM_TO_BERRY(ITEM_ENIGMA_BERRY))->name);
StringAppend(string, gOtherText_Berry2);
}
else
diff --git a/src/new_game.c b/src/new_game.c
index 683a22801..63a13be5e 100644
--- a/src/new_game.c
+++ b/src/new_game.c
@@ -38,7 +38,7 @@ extern u8 gPlayerPartyCount;
extern u8 gUnknown_03005CE8;
extern u16 gSaveFileStatus;
-extern u8 gUnknown_0819FA81[];
+extern u8 EventScript_ResetAllMapFlags[];
static const struct ContestWinner sEmptyMuseumPortrait =
{
@@ -202,7 +202,7 @@ void NewGameInitData(void)
ResetFanClub();
ResetLotteryCorner();
WarpToTruck();
- ScriptContext2_RunNewScript(gUnknown_0819FA81);
+ ScriptContext2_RunNewScript(EventScript_ResetAllMapFlags);
}
#if DEBUG
diff --git a/src/pokemon_item_effect.c b/src/pokemon_item_effect.c
index d59e8d77c..3ab351367 100644
--- a/src/pokemon_item_effect.c
+++ b/src/pokemon_item_effect.c
@@ -96,7 +96,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *pkmn, u16 item, u8 partyIndex, u8 mo
sp34 = 4;
}
- if (!IS_POKEMON_ITEM(item))
+ if (!ITEM_HAS_EFFECT(item))
return TRUE;
if (gItemEffectTable[item - 13] == NULL && item != ITEM_ENIGMA_BERRY)
return TRUE;