mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-18 17:34:20 +01:00
Add constants for flags and vars
This commit is contained in:
parent
3f1a7330dd
commit
46a3969f69
@ -1438,7 +1438,7 @@ static void Blender_SetOpponentsBerryData(u16 playerBerryItemId, u8 playersNum,
|
|||||||
{
|
{
|
||||||
opponentBerryId = sOpponentBerrySets[opponentSetId][i];
|
opponentBerryId = sOpponentBerrySets[opponentSetId][i];
|
||||||
var = playerBerryItemId - 163;
|
var = playerBerryItemId - 163;
|
||||||
if (!FlagGet(0x340) && gSpecialVar_0x8004 == 1)
|
if (!FlagGet(FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER_ONLOOKERS) && gSpecialVar_0x8004 == 1)
|
||||||
{
|
{
|
||||||
opponentSetId %= 5;
|
opponentSetId %= 5;
|
||||||
opponentBerryId = sSpecialOpponentBerrySets[opponentSetId];
|
opponentBerryId = sSpecialOpponentBerrySets[opponentSetId];
|
||||||
|
@ -447,25 +447,25 @@ bool8 ShouldDoBrailleRegicePuzzle(void)
|
|||||||
|
|
||||||
if (i < 16)
|
if (i < 16)
|
||||||
{
|
{
|
||||||
u16 val = VarGet(0x403B);
|
u16 val = VarGet(VAR_0x403B);
|
||||||
val |= 1 << i;
|
val |= 1 << i;
|
||||||
VarSet(0x403B, val);
|
VarSet(VAR_0x403B, val);
|
||||||
}
|
}
|
||||||
else if (i < 32)
|
else if (i < 32)
|
||||||
{
|
{
|
||||||
u16 val = VarGet(0x403C);
|
u16 val = VarGet(VAR_0x403C);
|
||||||
val |= 1 << (i - 16);
|
val |= 1 << (i - 16);
|
||||||
VarSet(0x403C, val);
|
VarSet(VAR_0x403C, val);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
u16 val = VarGet(0x403D);
|
u16 val = VarGet(VAR_0x403D);
|
||||||
val |= 1 << (i - 32);
|
val |= 1 << (i - 32);
|
||||||
VarSet(0x403D, val);
|
VarSet(VAR_0x403D, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
varValue = VarGet(0x403B);
|
varValue = VarGet(VAR_0x403B);
|
||||||
if (varValue != 0xFFFF || VarGet(0x403C) != varValue || VarGet(0x403D) != 0xF)
|
if (varValue != 0xFFFF || VarGet(VAR_0x403C) != varValue || VarGet(VAR_0x403D) != 0xF)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (gSaveBlock1Ptr->pos.x == 8 && gSaveBlock1Ptr->pos.y == 21)
|
if (gSaveBlock1Ptr->pos.x == 8 && gSaveBlock1Ptr->pos.y == 21)
|
||||||
|
@ -1244,17 +1244,17 @@ void sub_8127E18(void)
|
|||||||
|
|
||||||
for (i = 0; i < 14; i ++)
|
for (i = 0; i < 14; i ++)
|
||||||
{
|
{
|
||||||
if (FlagGet(0xAE + i) == TRUE)
|
if (FlagGet(FLAG_DECORATION_1 + i) == TRUE)
|
||||||
{
|
{
|
||||||
FlagClear(0xAE + i);
|
FlagClear(FLAG_DECORATION_1 + i);
|
||||||
for (j = 0; j < gMapHeader.events->eventObjectCount; j ++)
|
for (j = 0; j < gMapHeader.events->eventObjectCount; j ++)
|
||||||
{
|
{
|
||||||
if (gMapHeader.events->eventObjects[j].flagId == 0xAE + i)
|
if (gMapHeader.events->eventObjects[j].flagId == FLAG_DECORATION_1 + i)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VarSet(0x3F20 + gMapHeader.events->eventObjects[j].graphicsId, sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0]);
|
VarSet(VAR_0x3F20 + gMapHeader.events->eventObjects[j].graphicsId, sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0]);
|
||||||
gSpecialVar_0x8005 = gMapHeader.events->eventObjects[j].localId;
|
gSpecialVar_0x8005 = gMapHeader.events->eventObjects[j].localId;
|
||||||
gSpecialVar_0x8006 = sCurDecorMapX;
|
gSpecialVar_0x8006 = sCurDecorMapX;
|
||||||
gSpecialVar_0x8007 = sCurDecorMapY;
|
gSpecialVar_0x8007 = sCurDecorMapY;
|
||||||
|
@ -300,8 +300,8 @@ void Task_HandlePorthole(u8 taskId)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EXIT_PORTHOLE: // exit porthole.
|
case EXIT_PORTHOLE: // exit porthole.
|
||||||
FlagClear(0x4001);
|
FlagClear(FLAG_SPECIAL_FLAG_0x4001);
|
||||||
FlagClear(0x4000);
|
FlagClear(FLAG_SPECIAL_FLAG_0x4000);
|
||||||
SetWarpDestinationToDynamicWarp(0);
|
SetWarpDestinationToDynamicWarp(0);
|
||||||
DoDiveWarp();
|
DoDiveWarp();
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
@ -315,7 +315,7 @@ void sub_80FB6EC(void)
|
|||||||
|
|
||||||
gSprites[spriteId].coordOffsetEnabled = FALSE;
|
gSprites[spriteId].coordOffsetEnabled = FALSE;
|
||||||
|
|
||||||
if (VarGet(0x40B4) == 2)
|
if (VarGet(VAR_PORTHOLE_STATE) == 2)
|
||||||
{
|
{
|
||||||
StartSpriteAnim(&gSprites[spriteId], GetFaceDirectionAnimNum(4));
|
StartSpriteAnim(&gSprites[spriteId], GetFaceDirectionAnimNum(4));
|
||||||
}
|
}
|
||||||
@ -337,8 +337,8 @@ void sub_80FB768(void)
|
|||||||
void sub_80FB7A4(void)
|
void sub_80FB7A4(void)
|
||||||
{
|
{
|
||||||
FlagSet(FLAG_SYS_CRUISE_MODE);
|
FlagSet(FLAG_SYS_CRUISE_MODE);
|
||||||
FlagSet(0x4001);
|
FlagSet(FLAG_SPECIAL_FLAG_0x4001);
|
||||||
FlagSet(0x4000);
|
FlagSet(FLAG_SPECIAL_FLAG_0x4000);
|
||||||
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
|
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
|
||||||
sub_80FB59C();
|
sub_80FB59C();
|
||||||
sub_80AF8B8();
|
sub_80AF8B8();
|
||||||
|
10
src/tv.c
10
src/tv.c
@ -972,7 +972,7 @@ void GabbyAndTyBeforeInterview(void)
|
|||||||
TakeTVShowInSearchOfTrainersOffTheAir();
|
TakeTVShowInSearchOfTrainersOffTheAir();
|
||||||
if (gSaveBlock1Ptr->gabbyAndTyData.lastMove == MOVE_NONE)
|
if (gSaveBlock1Ptr->gabbyAndTyData.lastMove == MOVE_NONE)
|
||||||
{
|
{
|
||||||
FlagSet(0x0001);
|
FlagSet(FLAG_TEMP_1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2564,13 +2564,13 @@ void sub_80EEA70(void)
|
|||||||
show->secretBaseSecrets.kind = TVSHOW_SECRET_BASE_SECRETS;
|
show->secretBaseSecrets.kind = TVSHOW_SECRET_BASE_SECRETS;
|
||||||
show->secretBaseSecrets.active = FALSE;
|
show->secretBaseSecrets.active = FALSE;
|
||||||
StringCopy(show->secretBaseSecrets.playerName, gSaveBlock2Ptr->playerName);
|
StringCopy(show->secretBaseSecrets.playerName, gSaveBlock2Ptr->playerName);
|
||||||
show->secretBaseSecrets.stepsInBase = VarGet(0x40ec);
|
show->secretBaseSecrets.stepsInBase = VarGet(VAR_0x40EC);
|
||||||
sub_80E980C();
|
sub_80E980C();
|
||||||
StringCopy(strbuf, gStringVar1);
|
StringCopy(strbuf, gStringVar1);
|
||||||
StripExtCtrlCodes(strbuf);
|
StripExtCtrlCodes(strbuf);
|
||||||
StringCopy(show->secretBaseSecrets.baseOwnersName, strbuf);
|
StringCopy(show->secretBaseSecrets.baseOwnersName, strbuf);
|
||||||
show->secretBaseSecrets.item = VarGet(0x40ed);
|
show->secretBaseSecrets.item = VarGet(VAR_0x40ED);
|
||||||
show->secretBaseSecrets.flags = VarGet(0x40ee) + (VarGet(0x40ef) << 16);
|
show->secretBaseSecrets.flags = VarGet(VAR_0x40EE) + (VarGet(VAR_0x40EF) << 16);
|
||||||
tv_store_id_3x(show);
|
tv_store_id_3x(show);
|
||||||
show->secretBaseSecrets.language = gGameLanguage;
|
show->secretBaseSecrets.language = gGameLanguage;
|
||||||
if (show->secretBaseSecrets.language == LANGUAGE_JAPANESE || gSaveBlock1Ptr->secretBases[VarGet(VAR_CURRENT_SECRET_BASE)].language == LANGUAGE_JAPANESE)
|
if (show->secretBaseSecrets.language == LANGUAGE_JAPANESE || gSaveBlock1Ptr->secretBases[VarGet(VAR_CURRENT_SECRET_BASE)].language == LANGUAGE_JAPANESE)
|
||||||
@ -3604,7 +3604,7 @@ void sub_80F01B8(void)
|
|||||||
{
|
{
|
||||||
VarSet(VAR_0x40BC, 0);
|
VarSet(VAR_0x40BC, 0);
|
||||||
RemoveEventObjectByLocalIdAndMap(5, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
RemoveEventObjectByLocalIdAndMap(5, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||||
FlagSet(0x396);
|
FlagSet(FLAG_HIDE_BATTLE_TOWER_REPORTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReceiveTvShowsData(void *src, u32 size, u8 masterIdx)
|
void ReceiveTvShowsData(void *src, u32 size, u8 masterIdx)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user