Merge pull request #245 from mateon1/getentinfo
Some checks failed
GithubCI / build (push) Has been cancelled

Refactor as much as possible to GetEntInfo
This commit is contained in:
AnonymousRandomPerson 2024-10-29 12:56:33 -04:00 committed by GitHub
commit d6197d5176
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
58 changed files with 571 additions and 579 deletions

View File

@ -4,5 +4,6 @@
// This file gets included by each source file, just like in Chunsoft's original source, so we can have this string easily just like they did.
// Later, we can move this into "global.h" before the #ifdef guard. But we can only do this if "global.h" isn't included outside of .c files...
#include "gba/defines.h"
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
ALIGNED(4) static const u8 sFill[] = _("pksdir0");

View File

@ -145,7 +145,7 @@ void sub_804178C(u8 param_1)
u32 EntityGetStatusSprites(Entity *entity)
{
return entity->axObj.info->statusIcons;
return GetEntInfo(entity)->statusIcons;
}
void sub_8041888(u8 param_1)
@ -158,7 +158,7 @@ void sub_8041888(u8 param_1)
entity = gDungeon->allPokemon[index];
if(EntityExists(entity))
{
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
if(param_1)
{
entityInfo->unk14C = 1;
@ -177,7 +177,7 @@ void EntityUpdateStatusSprites(Entity *entity)
u8 temp;
if (EntityExists(entity)) {
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
spriteStatus = 0;
flag = TRUE;
@ -501,7 +501,7 @@ void sub_8041D5C(Entity *pokemon)
if (!sub_8042768(pokemon))
return;
sub_803ED30(pokemon->axObj.info->stockpileStage, pokemon, 1, 11);
sub_803ED30(GetEntInfo(pokemon)->stockpileStage, pokemon, 1, 11);
}
void sub_8041D84(Entity *pokemon)
@ -886,7 +886,7 @@ void sub_8042208(Entity *pokemon, u8 r1)
void sub_8042238(Entity *pokemon, Entity *target)
{
if(target->axObj.info->isNotTeamMember)
if(GetEntInfo(target)->isNotTeamMember)
PlaySoundEffect(0x157);
else
PlaySoundEffect(0x156);

View File

@ -108,7 +108,7 @@ void sub_80427AC(void)
for (i = 0; i < 20; i++) {
entity = gDungeon->allPokemon[i];
if (EntityExists(entity)) {
enInfo = entity->axObj.info;
enInfo = GetEntInfo(entity);
if (enInfo->unkF3) {
enInfo->unkF3 = FALSE;
sub_80429A0(entity);

View File

@ -41,13 +41,13 @@ Item * sub_8044CC8(Entity *param_1, unkStruct_8044CC8 *param_2)
}
else {
if (param_2->actionUseIndex == 0x81) {
info = param_1->axObj.info;
info = GetEntInfo(param_1);
}
else {
if (3 < (u8)(param_2->actionUseIndex + 0x70)) {
return NULL;
}
info = gDungeon->teamPokemon[param_2->actionUseIndex - 0x90]->axObj.info;
info = GetEntInfo(gDungeon->teamPokemon[param_2->actionUseIndex - 0x90]);
}
item = &info->heldItem;
}
@ -77,14 +77,14 @@ bool8 sub_8044D40(ActionContainer *param_1,s32 index)
}
Item *sub_8044D90(Entity *entity, s32 index, s32 unused) {
EntityInfo *info = entity->axObj.info;
EntityInfo *info = GetEntInfo(entity);
register unkStruct_8044CC8 *puVar1 asm("r3") = &info->action.unk4[index];
return sub_8044CC8(entity, puVar1);
}
Entity *sub_8044DA4(Entity *entity, s32 index)
{
EntityInfo *info = entity->axObj.info;
EntityInfo *info = GetEntInfo(entity);
return gDungeon->teamPokemon[info->action.unk4[index].actionUseIndex];
}
@ -103,7 +103,7 @@ void sub_8044DF0(Entity *entity, s32 index, u32 unused)
Item *item;
EntityInfo *info;
info = entity->axObj.info;
info = GetEntInfo(entity);
item = sub_8044D90(entity,index,unused);
if ((info->action).unk4[0].actionUseIndex == 0x80) {
sub_80461C8(&(info->action).unk4[0].lastItemThrowPosition,1);
@ -125,7 +125,7 @@ void sub_8044E24(Entity *entity,int index,u32 unused)
Item item;
itemPtr = sub_8044D90(entity,index,unused);
info = entity->axObj.info;
info = GetEntInfo(entity);
if (!IsHMItem(itemPtr->id)) {
if (GetItemCategory(itemPtr->id) == CATEGORY_TMS_HMS) {
if (info->action.unk4[index].actionUseIndex == 0x80) {
@ -231,7 +231,7 @@ bool8 IsNotAttacking(Entity *param_1, bool8 param_2)
EntityInfo *info;
u16 *action;
info = param_1->axObj.info;
info = GetEntInfo(param_1);
action = &(info->action).action;
if ((param_2 == 0) || (sub_8045888(param_1)))
{

View File

@ -69,7 +69,7 @@ void SetMessageArgument(char buffer[], Entity *entity, u32 param_3)
switch(GetEntityType(entity))
{
case ENTITY_MONSTER:
SetMessageArgument_2(buffer, entity->axObj.info, param_3);
SetMessageArgument_2(buffer, GetEntInfo(entity), param_3);
break;
case ENTITY_ITEM:
sub_8045BF8(buffer, GetItemData_1(entity));

View File

@ -165,8 +165,8 @@ bool8 sub_8047930(Entity *pokemon, Entity *target)
{
bool8 flag;
if (((target->axObj.info->shopkeeper == TRUE) ||
(target->axObj.info->clientType == CLIENT_TYPE_DONT_MOVE)) || (target->axObj.info->clientType == CLIENT_TYPE_CLIENT)) {
if (((GetEntInfo(target)->shopkeeper == TRUE) ||
(GetEntInfo(target)->clientType == CLIENT_TYPE_DONT_MOVE)) || (GetEntInfo(target)->clientType == CLIENT_TYPE_CLIENT)) {
return FALSE;
}
else {
@ -202,7 +202,7 @@ void sub_80479B8(char param_1, char param_2, u8 param_3, Entity *pokemon, Entity
if (param_1 != '\0') {
if (param_2 == '\0') {
flag = FALSE;
info = target->axObj.info;
info = GetEntInfo(target);
if (info->isNotTeamMember) {
if ((GetItemCategory(item->id) != CATEGORY_THROWN_LINE) && (GetItemCategory(item->id) != CATEGORY_BERRIES_SEEDS_VITAMINS)) {
flag = GetItemCategory(item->id) == CATEGORY_THROWN_ARC ? FALSE : TRUE;
@ -540,7 +540,7 @@ void EyedropSeedItemAction(Entity *pokemon, Entity *target)
void CheriBerryItemAction(Entity *pokemon, Entity *target)
{
if(target->axObj.info->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS)
if(GetEntInfo(target)->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS)
SendNonVolatileEndMessage(pokemon, target);
else
// Pointer to "But nothing happened!"
@ -549,7 +549,7 @@ void CheriBerryItemAction(Entity *pokemon, Entity *target)
void PechaBerryItemAction(Entity *pokemon, Entity *target)
{
if((u8)(target->axObj.info->nonVolatile.nonVolatileStatus - 2) <= 1)
if((u8)(GetEntInfo(target)->nonVolatile.nonVolatileStatus - 2) <= 1)
SendNonVolatileEndMessage(pokemon, target);
else
// Pointer to "But nothing happened!"
@ -594,7 +594,7 @@ void DoomSeedItemAction(Entity *pokemon, Entity *target)
void RawstBerryItemAction(Entity *pokemon, Entity *target)
{
if(target->axObj.info->nonVolatile.nonVolatileStatus == STATUS_BURN)
if(GetEntInfo(target)->nonVolatile.nonVolatileStatus == STATUS_BURN)
SendNonVolatileEndMessage(pokemon, target);
else
{
@ -606,12 +606,12 @@ void RawstBerryItemAction(Entity *pokemon, Entity *target)
void HungerSeedItemAction(Entity *pokemon, Entity * target)
{
EntityInfo *entityInfo = target->axObj.info;
if (target->axObj.info->isTeamLeader)
EntityInfo *entityInfo = GetEntInfo(target);
if (GetEntInfo(target)->isTeamLeader)
sub_8078A58(pokemon, target, 0, 5);
else
{
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames, target, 0);
if (IQSkillIsEnabled(target, IQ_SELF_CURER))
TryDisplayDungeonLoggableMessage3(pokemon, target, *gPtrSelfHealPreventedHungerMessage);
@ -645,7 +645,7 @@ void GinsengItemAction(Entity *pokemon, Entity * target)
isMoveBoosted = FALSE;
moveBoost = 1;
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if (DungeonRandInt(100) < gUnknown_80F4F46)
moveBoost = 3;
if (entityInfo->isTeamLeader) {
@ -687,7 +687,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3)
u8 auStack28 [4];
if (param_3 != 0) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
entityInfo_1 = entityInfo;
if (gDungeon->unk675 != 0) {
uVar1 = gUnknown_80F4FA8;
@ -711,7 +711,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3)
}
else
{
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
if (gDungeon->unk675 != 0) {
uVar1 = gUnknown_80F4FAA;
TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FEAE8);
@ -742,7 +742,7 @@ void HandleGummiItemAction(Entity *pokemon, Entity *target, u8 gummiIndex)
s32 iVar5;
s32 currIQ;
targetInfo = target->axObj.info;
targetInfo = GetEntInfo(target);
gummiBoost = gTypeGummiIQBoost[targetInfo->types[0]][gummiIndex];
gummiBoost += gTypeGummiIQBoost[targetInfo->types[1]][gummiIndex];
sub_8078B5C(pokemon,target,
@ -829,7 +829,7 @@ bool8 sub_8048950(Entity *param_1,Item *item)
{
entity = gDungeon->teamPokemon[index];
if (EntityExists(entity)) {
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
flag = CanMonLearnMove(moveID, entityInfo->id);
if (CheckVariousStatuses2(entity, FALSE)) {
flag = FALSE;
@ -882,7 +882,7 @@ bool8 sub_8048A68(Entity *param_1,Item *item)
{
entity = gDungeon->teamPokemon[index];
if (EntityExists(entity)) {
pEVar6 = entity->axObj.info;
pEVar6 = GetEntInfo(entity);
flag = TRUE;
if(((MAX_TEAM_MEMBERS - 1) < pEVar6->teamIndex))
flag = FALSE;
@ -940,7 +940,7 @@ bool32 sub_8048B9C(Entity *entity,Item *param_2)
u16 action;
bVar2 = FALSE;
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
actionPointer = &(entityInfo->action);
if ((param_2->flags & ITEM_FLAG_STICKY)) {
DisplayDungeonMessage(0,*gItemStickyDoesntWorkText,1);
@ -952,7 +952,7 @@ bool32 sub_8048B9C(Entity *entity,Item *param_2)
{
entity1 = gDungeon->teamPokemon[index];
if (EntityExists(entity1)) {
entity1Info = entity1->axObj.info;
entity1Info = GetEntInfo(entity1);
flag = TRUE;
if(CheckVariousStatuses2(entity1, FALSE))
{
@ -976,7 +976,7 @@ bool32 sub_8048B9C(Entity *entity,Item *param_2)
else
{
while( TRUE ) {
entityInfo = entity2->axObj.info;
entityInfo = GetEntInfo(entity2);
actionContainer = *actionPointer;
goto _clear;
_load:
@ -1032,7 +1032,7 @@ bool8 sub_8048D50(Entity * pokemon, Item *item)
{
EntityInfo *entityInfo;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
if ((item->flags & ITEM_FLAG_STICKY) != 0) {
sub_8045BF8(gFormatItems, item);

View File

@ -23,7 +23,7 @@ void sub_8068768(void)
entity = gDungeon->allPokemon[i];
if (entity != NULL && EntityExists(entity))
LoadPokemonSprite(entity->axObj.info->apparentID, FALSE);
LoadPokemonSprite(GetEntInfo(entity)->apparentID, FALSE);
}
}

View File

@ -1349,7 +1349,7 @@ void sub_805E738(Entity *a0)
{
Tile *tile;
s32 i, j;
EntityInfo *entityInfo = a0->axObj.info;
EntityInfo *entityInfo = GetEntInfo(a0);
if (entityInfo->eyesightStatus.eyesightStatus != 1 && entityInfo->eyesightStatus.eyesightStatus != 2) {
// What???
for (i = 0; i < 1; i++) {
@ -1360,7 +1360,7 @@ void sub_805E738(Entity *a0)
direction &= DIRECTION_MASK;
tile = GetTile(a0->pos.x + gAdjacentTileOffsets[direction].x, a0->pos.y + gAdjacentTileOffsets[direction].y);
if (tile->monster != NULL && GetEntityType(tile->monster) == ENTITY_MONSTER) {
EntityInfo *tileMonsterInfo = tile->monster->axObj.info;
EntityInfo *tileMonsterInfo = GetEntInfo(tile->monster);
if (CanSeeTarget(a0, tile->monster)) {
if (i != 0 || tileMonsterInfo->isNotTeamMember) {
r9 = TRUE;
@ -1370,7 +1370,7 @@ void sub_805E738(Entity *a0)
}
}
if (r9) {
a0->axObj.info->action.direction = direction & DIRECTION_MASK;
GetEntInfo(a0)->action.direction = direction & DIRECTION_MASK;
sub_806CDD4(a0, sub_806CEBC(a0), direction);
break;
}
@ -1398,7 +1398,7 @@ bool8 sub_805E874(void)
s32 yArray[3];
Dungeon *dungeon = gDungeon;
Entity *leader = GetLeader();
s32 direction = leader->axObj.info->action.direction;
s32 direction = GetEntInfo(leader)->action.direction;
s32 x = leader->pos.x;
s32 y = leader->pos.y;
Tile *leaderTile = GetTile(x, y);
@ -1604,7 +1604,7 @@ void sub_805EE30(void)
return;
tile = GetTileAtEntitySafe(leader);
if (IQSkillIsEnabled(leader, IQ_SUPER_MOBILE) && leader->axObj.info->transformStatus.transformStatus != STATUS_MOBILE && !HasHeldItem(leader, ITEM_MOBILE_SCARF))
if (IQSkillIsEnabled(leader, IQ_SUPER_MOBILE) && GetEntInfo(leader)->transformStatus.transformStatus != STATUS_MOBILE && !HasHeldItem(leader, ITEM_MOBILE_SCARF))
sub_804AE84(&leader->pos);
if (tile->terrainType & TERRAIN_TYPE_STAIRS)
gDungeon->unk1 = 1;
@ -1668,7 +1668,7 @@ bool8 sub_805EF60(Entity *a0, EntityInfo *a1)
return FALSE;
if (!sub_8070BC0(a0))
return FALSE;
if (r4->axObj.info->isNotTeamMember && r4->axObj.info->clientType != CLIENT_TYPE_CLIENT && r4->axObj.info->shopkeeper != 1)
if (GetEntInfo(r4)->isNotTeamMember && GetEntInfo(r4)->clientType != CLIENT_TYPE_CLIENT && GetEntInfo(r4)->shopkeeper != 1)
return FALSE;
SetMonsterActionFields(&a1->action, ACTION_TALK_FIELD);
@ -1712,8 +1712,8 @@ void sub_805F02C(void)
s32 i;
Entity *r7 = gDungeon->unkBC;
Entity *leader = GetLeader();
EntityInfo *r8 = r7->axObj.info;
EntityInfo *leaderInfo = leader->axObj.info;
EntityInfo *r8 = GetEntInfo(r7);
EntityInfo *leaderInfo = GetEntInfo(leader);
if (r8->isTeamLeader) {
DisplayDungeonLoggableMessageTrue(r7, gUnknown_80F9BD8);
@ -1962,7 +1962,7 @@ void ShowFieldMenu(u8 a0_, bool8 a1)
for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
Entity *teamMon = gDungeon->teamPokemon[i];
if (EntityExists(teamMon)) {
if (teamMon->axObj.info->isTeamLeader) {
if (GetEntInfo(teamMon)->isTeamLeader) {
r7 = i;
break;
}
@ -2226,7 +2226,7 @@ void DrawFieldMenu(u8 a0)
sub_80073E0(0);
if (a0) {
u32 hours, minutes, seconds;
EntityInfo *leaderInfo = GetLeader()->axObj.info;
EntityInfo *leaderInfo = GetEntInfo(GetLeader());
const u8 *dungeonName = GetCurrentDungeonName();
x = (136 - sub_8008ED0(dungeonName)) / 2;
@ -2253,7 +2253,7 @@ void DrawFieldMenu(u8 a0)
for (yLoop = 0, i = 0; i < MAX_TEAM_MEMBERS; i++) {
Entity *teamMon = gDungeon->teamPokemon[i];
if (EntityExists(teamMon)) {
EntityInfo *monInfo = teamMon->axObj.info;
EntityInfo *monInfo = GetEntInfo(teamMon);
SetMessageArgument(gAvailablePokemonNames, teamMon, 0);
gFormatData_202DE30[0] = monInfo->HP;
gFormatData_202DE30[1] = monInfo->maxHPStat;
@ -2398,7 +2398,7 @@ bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1)
u8 var_30 = 0;
u8 var_2C = 0;
u8 var_28 = 0;
EntityInfo *a0Info = a0->axObj.info;
EntityInfo *a0Info = GetEntInfo(a0);
UnkTextStruct2_sub2 var_3C;
UnkTextStruct3 var_FC =
@ -2453,7 +2453,7 @@ bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1)
for (i_r6 = 0; i_r6 < MAX_TEAM_MEMBERS; i_r6++) {
Entity *teamMon = gDungeon->teamPokemon[i_r6];
if (EntityExists(teamMon)) {
EntityInfo *monInfo = teamMon->axObj.info;
EntityInfo *monInfo = GetEntInfo(teamMon);
if (monInfo->heldItem.flags & ITEM_FLAG_EXISTS && monInfo->heldItem.flags & ITEM_FLAG_UNPAID) {
monInfo->heldItem.flags &= ~(ITEM_FLAG_UNPAID);
for (i = 0; i < sUnknown_202F258; i++) {
@ -2673,7 +2673,7 @@ void CreateFieldItemMenu(s32 a0, Entity *a1, bool8 a2, bool8 a3, UnkTextStruct3
EntityInfo *a1Info;
var_94 = gUnknown_8106B6C;
a1Info = a1->axObj.info;
a1Info = GetEntInfo(a1);
r10 = sub_8060800(a5, a0);
gUnknown_202EE10.menuIndex = sUnknown_202F240;
gUnknown_202EE10.unk1A = 0;
@ -2774,7 +2774,7 @@ void CreateFieldItemMenu(s32 a0, Entity *a1, bool8 a2, bool8 a3, UnkTextStruct3
}
break;
case 3: {
Item *item = &a1->axObj.info->heldItem;
Item *item = &GetEntInfo(a1)->heldItem;
SetMessageArgument_2(gAvailablePokemonNames, a1Info, 0);
PrintFormatStringOnWindow(x, 0, gUnknown_80FE940, 0, 0);
if (item->flags & ITEM_FLAG_EXISTS) {
@ -2788,9 +2788,9 @@ void CreateFieldItemMenu(s32 a0, Entity *a1, bool8 a2, bool8 a3, UnkTextStruct3
default: {
Entity *chosenTeamMember = gDungeon->teamPokemon[sUnknown_202F248[a0] - MAX_TEAM_MEMBERS];
if (EntityExists(chosenTeamMember)) {
Item *item = &chosenTeamMember->axObj.info->heldItem;
Item *item = &GetEntInfo(chosenTeamMember)->heldItem;
SetMessageArgument_2(gAvailablePokemonNames,
chosenTeamMember->axObj.info, 0);
GetEntInfo(chosenTeamMember), 0);
PrintFormatStringOnWindow(x, 0, gUnknown_80FE940, 0, 0);
if (item->flags & ITEM_FLAG_EXISTS) {
gUnknown_202EE10.unk1A++;
@ -2886,7 +2886,7 @@ void sub_8060900(Entity *a0)
{
u16 val_sub8044DC8;
Item *item = sub_8044CC8(a0, &sUnknownActionUnk4, 0xA);
EntityInfo *a0Info = a0->axObj.info;
EntityInfo *a0Info = GetEntInfo(a0);
gUnknown_202EE6C = 0;
if (sUnknownActionUnk4.actionUseIndex < 144) {
@ -2955,7 +2955,7 @@ void sub_8060900(Entity *a0)
for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
Entity *teamMon = gDungeon->teamPokemon[i];
if (EntityExists(teamMon)) {
EntityInfo *teamMonInfo = teamMon->axObj.info;
EntityInfo *teamMonInfo = GetEntInfo(teamMon);
teamMonInfo->unk157 = FALSE;
if (!CheckVariousConditions(teamMon)) {
r8 = TRUE;
@ -3013,7 +3013,7 @@ void sub_8060900(Entity *a0)
Entity *teamMon = gDungeon->teamPokemon[index];
if (EntityExists(teamMon)) {
bool32 r5, r6, r4;
EntityInfo *teamMonInfo = teamMon->axObj.info;
EntityInfo *teamMonInfo = GetEntInfo(teamMon);
r5 = FALSE;
if (CheckVariousConditions(teamMon))
@ -3114,7 +3114,7 @@ s32 sub_8060D64(s16 *a0, bool8 a1, bool8 a2, bool8 a3, Entity *a4)
if (!a1 && !a3) {
for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
Entity *teamMon = gDungeon->teamPokemon[i];
if (EntityExists(teamMon) && teamMon->axObj.info->heldItem.flags & ITEM_FLAG_EXISTS) {
if (EntityExists(teamMon) && GetEntInfo(teamMon)->heldItem.flags & ITEM_FLAG_EXISTS) {
a0[count++] = i + MAX_TEAM_MEMBERS;
}
}
@ -3160,7 +3160,7 @@ bool8 sub_8060E38(Entity *a0)
for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
Entity *teamMon = gDungeon->teamPokemon[i];
if (EntityExists(teamMon)) {
teamMon->axObj.info->unk157 = TRUE;
GetEntInfo(teamMon)->unk157 = TRUE;
}
}
@ -3235,7 +3235,7 @@ bool8 sub_8060E38(Entity *a0)
sTeamMenuChosenId = gUnknown_202EE10.menuIndex;
sub_806145C(&sp);
if (r10) {
EntityInfo *info = a0->axObj.info;
EntityInfo *info = GetEntInfo(a0);
SetMonsterActionFields(&info->action, 0x1B);
info->action.unk4[0].actionUseIndex = sp.unk4[sp.unk0];
ret = FALSE;
@ -3256,7 +3256,7 @@ bool8 sub_8060E38(Entity *a0)
}
if ((gRealInputs.pressed & A_BUTTON) || gUnknown_202EE10.unk28.a_button) {
if (sub_8044F3C(gUnknown_202EE10.menuIndex)) {
sub_80615B4(&a0->axObj.info->action, &sp);
sub_80615B4(&GetEntInfo(a0)->action, &sp);
sub_8083D08();
r4 = FALSE;
break;
@ -3317,7 +3317,7 @@ void DrawFieldTeamMenu(struct UnkFieldTeamMenuStruct *a0, UnkTextStruct3 *a1, bo
Entity *teamMon = gDungeon->teamPokemon[i];
if (EntityExists(teamMon)) {
a0->unk4[count] = i;
monInfo = teamMon->axObj.info;
monInfo = GetEntInfo(teamMon);
a0->unk14[count] = monInfo->unk157;
if (pos.x == teamMon->pos.x && pos.y == teamMon->pos.y && sTeamMenuChosenId < 0) {
sTeamMenuChosenId = count;
@ -3379,7 +3379,7 @@ void DrawFieldTeamMenu(struct UnkFieldTeamMenuStruct *a0, UnkTextStruct3 *a1, bo
Entity *teamMon = gDungeon->teamPokemon[id];
if (EntityExists(teamMon))
{
EntityInfo *monInfo = teamMon->axObj.info;
EntityInfo *monInfo = GetEntInfo(teamMon);
s32 color = (a0->unk14[i] != 0) ? 6 : 2;
sub_8070968(gAvailablePokemonNames, monInfo, color);
@ -3526,7 +3526,7 @@ void ShowTacticsMenu(ActionContainer *a0)
SetTxtStruct(&sp);
teamMon = gDungeon->teamPokemon[a0->unk4[0].actionUseIndex];
monInfo = teamMon->axObj.info;
monInfo = GetEntInfo(teamMon);
menuIndex = 0;
scrollFirstId = 0;
while (1) {

View File

@ -41,7 +41,7 @@ extern void sub_8045DB4(Position *, u32);
void HandlePickUpPlayerAction(Entity *entity)
{
entity->axObj.info->action.unk4[0].actionUseIndex = 1;
GetEntInfo(entity)->action.unk4[0].actionUseIndex = 1;
sub_8045DB4(&entity->pos,0);
}
@ -125,8 +125,8 @@ void HandleGiveItemAction(Entity *param_1)
Item item3;
entity = sub_8044DA4(param_1,1);
info1 = param_1->axObj.info;
info2 = entity->axObj.info;
info1 = GetEntInfo(param_1);
info2 = GetEntInfo(entity);
item = sub_8044D90(param_1,0,2);
if((info1->action).unk4[0].actionUseIndex == 0x80)
@ -200,7 +200,7 @@ void HandleTakeItemAction(Entity *param_1)
Item item;
entity = sub_8044DA4(param_1,0);
info = entity->axObj.info;
info = entity->axObj.info; // GetEntInfo doesn't work here, probably fixable
info2 = entity->axObj.info;
heldItem = &info->heldItem;
if ((gTeamInventoryRef->teamItems[ITEM_POWER_BAND].flags & ITEM_FLAG_EXISTS)) {
@ -284,7 +284,7 @@ void HandleUseItemAction(Entity *param_1)
Entity *entity;
entity = sub_8044DA4(param_1,0);
entity->axObj.info->useHeldItem = TRUE;
GetEntInfo(entity)->useHeldItem = TRUE;
}
void HandlePlaceItemAction(Entity *param_1)
@ -300,7 +300,7 @@ void HandlePlaceItemAction(Entity *param_1)
entity = param_1;
info = entity->axObj.info;
info = GetEntInfo(entity);
item = sub_8044D90(entity,0,4);
sub_8045BF8(gFormatItems,item);
if (info->action.unk4[0].actionUseIndex == 0x80) {

View File

@ -7,7 +7,7 @@ u32 sub_8069D18(Position *pos,Entity *entity)
{
EntityInfo *info;
info = entity->axObj.info;
info = GetEntInfo(entity);
pos->x = (entity->pos).x + gAdjacentTileOffsets[(info->action).direction].x;
pos->y = (entity->pos).y + gAdjacentTileOffsets[(info->action).direction].y;
@ -19,7 +19,7 @@ void sub_8069D4C(struct unkStruct_8069D4C *r0, Entity *target)
EntityInfo *info;
LevelData leveldata;
info = target->axObj.info;
info = GetEntInfo(target);
r0->id = info->id;
r0->pos = target->pos;

View File

@ -51,7 +51,7 @@ void sub_8069E0C(Entity *pokemon)
s32 index;
EntityInfo *entityInfo;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
if (HasAbility(pokemon, ABILITY_FORECAST)) {
entityInfo->types[0] = gUnknown_80F520C[GetApparentWeather(pokemon)].unk0;
entityInfo->types[1] = TYPE_NONE;
@ -142,9 +142,9 @@ void sub_8069F9C(Entity *pokemon,Entity * target,Move *move)
return;
}
iVar7 = pokemon->axObj.info;
iVar7 = GetEntInfo(pokemon);
iVar8 = iVar7;
iVar6 = target->axObj.info;
iVar6 = GetEntInfo(target);
abilityIndex = -1;
if (iVar6->abilities[0] == ABILITY_TRACE) {
abilityIndex = 0;
@ -210,7 +210,7 @@ void sub_806A120(Entity * pokemon, Entity * target, Move* move)
EntityInfo *entityInfo;
if ((((EntityExists(pokemon)) && (EntityExists(target))) && (pokemon != target))
&& (entityInfo = target->axObj.info, entityInfo->protection.protectionStatus == STATUS_CONVERSION2)) {
&& (entityInfo = GetEntInfo(target), entityInfo->protection.protectionStatus == STATUS_CONVERSION2)) {
moveType = GetMoveTypeForMonster(pokemon, move);
uVar2_u32 = sub_8092364(moveType);
if (uVar2_u32 != TYPE_NONE) {
@ -240,7 +240,7 @@ void sub_806A1E8(Entity *pokemon)
bVar3 = FALSE;
if (EntityExists(pokemon)) {
if (GetEntityType(pokemon) == ENTITY_MONSTER) {
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
bVar3 = (!entityInfo->isNotTeamMember);
}
if (gGameOptionsRef->FarOffPals == '\0') {
@ -260,7 +260,7 @@ void sub_806A240(Entity *pokemon, Entity *target)
isNotTeamMember = FALSE;
if (EntityExists(pokemon)){
if (GetEntityType(pokemon) == ENTITY_MONSTER) {
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
isNotTeamMember = (!entityInfo->isNotTeamMember);
}
if (isNotTeamMember && (!sub_8045888(pokemon))) {
@ -268,7 +268,7 @@ void sub_806A240(Entity *pokemon, Entity *target)
return;
}
else if (GetEntityType(target) == ENTITY_MONSTER) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
isNotTeamMember = (!entityInfo->isNotTeamMember);
}
if (isNotTeamMember && (!sub_8045888(target))) {
@ -320,7 +320,7 @@ void sub_806A390(Entity *pokemon)
EntityInfo *info;
Move *move;
info = pokemon->axObj.info;
info = GetEntInfo(pokemon);
for(index = 0; index < MAX_MON_MOVES; index++)
{
move = &info->moves.moves[index];

View File

@ -53,7 +53,7 @@ void sub_806CC10(void)
entity = gDungeon->allPokemon[i];
if (EntityExists(entity)) {
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
if (entityInfo->unk166 != 0) {
entityInfo->unk166--;
@ -83,7 +83,7 @@ void sub_806CCB4(Entity *entity, u8 a1)
bool8 flag;
EntityInfo *info;
info = entity->axObj.info;
info = GetEntInfo(entity);
flag = gDungeon->unk181e8.hallucinating;
if (entity == gDungeon->unk181e8.cameraTarget)
@ -149,7 +149,7 @@ void sub_806CE34(Entity *entity, u32 newDir)
entity->axObj.unk42_animId1 = sub_806CEBC(entity);
if (newDir < NUM_DIRECTIONS) {
entity->axObj.info->action.direction = newDir & DIRECTION_MASK;
GetEntInfo(entity)->action.direction = newDir & DIRECTION_MASK;
entity->axObj.unk44_direction1 = newDir & DIRECTION_MASK;
}
}
@ -196,7 +196,7 @@ u8 sub_806CEBC(Entity *entity)
void sub_806CEFC(Entity *entity, u32 newDir)
{
entity->axObj.info->action.direction = newDir & DIRECTION_MASK;
GetEntInfo(entity)->action.direction = newDir & DIRECTION_MASK;
sub_806CE68(entity, newDir & DIRECTION_MASK);
}
@ -208,7 +208,7 @@ void sub_806CF18(Entity *entity)
if (!EntityExists(entity))
return;
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
for (i = 0; i < 100; i++) {
sub_803E46C(33);
@ -219,7 +219,7 @@ void sub_806CF18(Entity *entity)
u8 sub_806CF54(Entity *entity)
{
return entity->axObj.info->unk204;
return GetEntInfo(entity)->unk204;
}
void sub_806CF60(void)
@ -244,7 +244,7 @@ u32 sub_806CF98(Entity *entity)
mapTile = GetTileAtEntitySafe(entity);
terrainType = mapTile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY);
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
shadowSize = GetShadowSize(entityInfo->apparentID);
if (terrainType == (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))
@ -346,19 +346,19 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *
return;
r9 = arg8;
if (CheckVariousStatuses(target) || target->axObj.info->charging.chargingStatus != 0)
if (CheckVariousStatuses(target) || GetEntInfo(target)->charging.chargingStatus != 0)
r9 = FALSE;
if (r9
&& abs(attacker->pos.x - target->pos.x) <= 1 && abs(attacker->pos.y - target->pos.y) <= 1
&& attacker != target
&& IsTypePhysical(dmgStruct->type)
&& target->axObj.info->protection.protectionStatus == STATUS_VITAL_THROW)
&& GetEntInfo(target)->protection.protectionStatus == STATUS_VITAL_THROW)
{
sub_8042730(target, attacker);
sub_807F43C(target, attacker);
}
if (target->axObj.info->charging.chargingStatus == STATUS_ENRAGED) {
if (GetEntInfo(target)->charging.chargingStatus == STATUS_ENRAGED) {
RaiseAttackStageTarget(attacker, target, gUnknown_8106A4C, 1);
}
@ -370,15 +370,15 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *
&& abs(attacker->pos.x - target->pos.x) <= 1 && abs(attacker->pos.y - target->pos.y) <= 1)
{
bool32 isPhysical = IsTypePhysical(dmgStruct->type);
if (target->axObj.info->protection.protectionStatus == STATUS_COUNTER && isPhysical) {
if (GetEntInfo(target)->protection.protectionStatus == STATUS_COUNTER && isPhysical) {
sub_8041B18(target);
returnDmg += 4;
}
if (target->axObj.info->protection.protectionStatus == STATUS_MINI_COUNTER && isPhysical) {
if (GetEntInfo(target)->protection.protectionStatus == STATUS_MINI_COUNTER && isPhysical) {
sub_8041B18(target);
returnDmg += 1;
}
if (target->axObj.info->protection.protectionStatus == STATUS_MIRROR_COAT && !isPhysical) {
if (GetEntInfo(target)->protection.protectionStatus == STATUS_MIRROR_COAT && !isPhysical) {
sub_8041B90(target);
returnDmg += 4;
}
@ -409,7 +409,7 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *
&& abs(attacker->pos.x - target->pos.x) <= 1 && abs(attacker->pos.y - target->pos.y) <= 1)
{
bool32 isPhysical = IsTypePhysical(dmgStruct->type);
EntityInfo *attackerInfo = attacker->axObj.info;
EntityInfo *attackerInfo = GetEntInfo(attacker);
if (HasAbility(target, ABILITY_ARENA_TRAP)
&& !MonsterIsType(attacker, TYPE_FLYING)
@ -481,7 +481,7 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *
if (destBondTarget == NULL) {
targetInfo->linked.linkedStatus = 0;
}
else if (destBondTarget->axObj.info->unk98 != targetInfo->linked.unkD4) {
else if (GetEntInfo(destBondTarget)->unk98 != targetInfo->linked.unkD4) {
targetInfo->linked.linkedStatus = 0;
}
else {
@ -517,7 +517,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
TrySendImmobilizeSleepEndMsg(attacker, target);
SetShopkeeperAggression(attacker, target);
if (GetEntityType(attacker) == ENTITY_MONSTER
&& attacker->axObj.info->moveStatus.moveStatus == STATUS_SET_DAMAGE
&& GetEntInfo(attacker)->moveStatus.moveStatus == STATUS_SET_DAMAGE
&& dmgStruct->unkE == 0)
{
dmgStruct->dmg = gUnknown_80F4F8C;
@ -651,7 +651,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
}
TargetTileInFront(target);
}
sub_806CDD4(target, 6, target->axObj.info->action.direction);
sub_806CDD4(target, 6, GetEntInfo(target)->action.direction);
sub_80420E8(target, dmgStruct);
var_24 = TRUE;
}
@ -968,7 +968,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
}
}
if (EntityExists(attacker) && GetEntityType(attacker) == ENTITY_MONSTER && !attacker->axObj.info->isTeamLeader)
if (EntityExists(attacker) && GetEntityType(attacker) == ENTITY_MONSTER && !GetEntInfo(attacker)->isTeamLeader)
r10 = FALSE;
if (r10) {

View File

@ -39,7 +39,7 @@ void sub_806E8B0(Entity * pokemon, Entity * target, u8 param_3, s32 *param_4, s3
if (HasAbility(pokemon, ABILITY_GUTS)) {
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
hasNegStatus_pokemon = HasNegativeStatus(pokemon);
visFlags_pokemon_1 = SetVisualFlags(entityInfo,1,hasNegStatus_pokemon);
if (hasNegStatus_pokemon) {
@ -52,7 +52,7 @@ void sub_806E8B0(Entity * pokemon, Entity * target, u8 param_3, s32 *param_4, s3
}
if ((HasAbility(pokemon, ABILITY_HUGE_POWER)) || (HasAbility(pokemon, ABILITY_PURE_POWER))) {
entityInfo_1 = pokemon->axObj.info;
entityInfo_1 = GetEntInfo(pokemon);
iVar3 = 0;
if ((param_6 < 0x21) && (!r10)) {
iVar3 = 1;
@ -73,7 +73,7 @@ void sub_806E8B0(Entity * pokemon, Entity * target, u8 param_3, s32 *param_4, s3
r8 <<= 1;
}
if(pokemon->axObj.info->isNotTeamMember)
if(GetEntInfo(pokemon)->isNotTeamMember)
{
isNotEnemy = FALSE;
}
@ -99,7 +99,7 @@ void sub_806E8B0(Entity * pokemon, Entity * target, u8 param_3, s32 *param_4, s3
}
if ((HasAbility(target, ABILITY_MARVEL_SCALE)) && (!r10)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
hasNegStatus_target = HasNegativeStatus(target);
visFlags_target = SetVisualFlags(entityInfo, 8, hasNegStatus_target);
if (hasNegStatus_target) {

View File

@ -64,7 +64,7 @@ void SetShopkeeperAggression(Entity *pokemon, Entity *target)
{
if(GetEntityType(pokemon) == ENTITY_MONSTER)
{
if(pokemon->axObj.info->isNotTeamMember)
if(GetEntInfo(pokemon)->isNotTeamMember)
{
info->shopkeeper = SHOPKEEPER_MODE_ATTACK_ENEMIES;
}
@ -97,7 +97,7 @@ void sub_806F480(Entity *pokemon, u8 r1)
u8 sub_806F4A4(Entity *pokemon, u8 type) {
EntityInfo *info = pokemon->axObj.info;
EntityInfo *info = GetEntInfo(pokemon);
s32 index;
if(MonsterIsType(pokemon, TYPE_GHOST))
@ -666,10 +666,10 @@ void sub_806F910(void)
{
entity = gDungeon->teamPokemon[index];
if (EntityExists(entity)) {
size = GetBodySize(entity->axObj.info->apparentID);
size = GetBodySize(GetEntInfo(entity)->apparentID);
entity->axObj.unk40_maybeAnimTimer = sVar6;
entity->axObj.info->unk167 = index;
entity->axObj.info->unk168 = size;
GetEntInfo(entity)->unk167 = index;
GetEntInfo(entity)->unk168 = size;
for (counter = 0; counter < size; counter++) {
if (totalSize < MAX_TEAM_BODY_SIZE) {
gUnknown_202EE70[totalSize] = 1;
@ -844,7 +844,7 @@ bool8 sub_806FD18(Entity *param_1)
EntityInfo *info;
int index;
info = param_1->axObj.info;
info = GetEntInfo(param_1);
iVar4 = -1;
size = GetBodySize((int)info->apparentID);
if (sub_806F9BC((int)info->id) != 0) {

View File

@ -175,7 +175,7 @@ void sub_8071D4C(Entity *pokemon, Entity *target, s32 exp)
s32 expDiff;
EntityInfo *info;
info = target->axObj.info;
info = GetEntInfo(target);
if (info->level != 100) {
if (!IsClientOrTeamBase(info->joinedAt.joinedAt)) {
newExp = info->exp + exp;
@ -514,7 +514,7 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para
if (EntityExists(target)) {
flag = 0;
info = target->axObj.info;
info = GetEntInfo(target);
if (info->isTeamLeader) {
GetAvailTacticsforLvl_Bool(tacticsBuffer1,info->level);
}
@ -573,7 +573,7 @@ void sub_807218C(Entity *pokemon)
s32 r3;
r6 = 0;
info = pokemon->axObj.info;
info = GetEntInfo(pokemon);
sub_806A2BC(pokemon, 0);
SetMessageArgument_2(gAvailablePokemonNames, info, 0);
@ -654,7 +654,7 @@ void LevelDownTarget(Entity *pokemon, Entity *target, u32 level)
if(EntityExists(target))
{
flag = FALSE;
info = target->axObj.info;
info = GetEntInfo(target);
if(!IsClientOrTeamBase(info->joinedAt.joinedAt))
{
newLevel = info->level - level;
@ -689,7 +689,7 @@ bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4)
s32 exp;
if(!EntityExists(target)) return FALSE;
info = target->axObj.info;
info = GetEntInfo(target);
id = info->id;
exp = info->exp;
@ -785,7 +785,7 @@ bool8 sub_80725A4(Entity *pokemon, Entity *target)
if(!EntityExists(target)) return FALSE;
info = target->axObj.info;
info = GetEntInfo(target);
id = info->id;
exp = info->exp;
oldLevel = info->level;

View File

@ -110,7 +110,7 @@ void sub_8072B78(Entity *pokemon, Entity *target, s16 id)
struct unkStruct_806B7F8 local_2c;
id_s32 = id;
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument_2(gAvailablePokemonNames,entityInfo,0);
CopyCyanMonsterNametoBuffer(gAvailablePokemonNames + 0x50,id_s32);
file = GetSpriteData(id_s32);

View File

@ -135,7 +135,7 @@ void sub_8073D14(Entity *entity)
{
Item *groundItem;
EntityInfo *_entityInfo;
EntityInfo *entityInfo = entity->axObj.info;
EntityInfo *entityInfo = GetEntInfo(entity);
Entity *tileObject = GetTileAtEntitySafe(entity)->object;
if (tileObject == NULL)
return;
@ -151,7 +151,7 @@ void sub_8073D14(Entity *entity)
if (entityInfo->clientType == CLIENT_TYPE_CLIENT)
return;
_entityInfo = entity->axObj.info; // Reloaded as a new variable for some reason.
_entityInfo = GetEntInfo(entity); // Reloaded as a new variable for some reason.
groundItem = GetItemData(tileObject);
if (groundItem->flags & ITEM_FLAG_IN_SHOP)
return;
@ -290,7 +290,7 @@ void sub_8074094(Entity *entity)
if (!EntityExists(entity) || sub_8044B28())
return;
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
entityInfo->unk146 = 0;
sub_805229C();
sub_807E8F0(entity);
@ -539,7 +539,7 @@ void sub_8074094(Entity *entity)
entityInfo->linked.linkedStatus = 0;
}
else {
EntityInfo *targetInfo = target->axObj.info;
EntityInfo *targetInfo = GetEntInfo(target);
if (targetInfo->unk98 != entityInfo->linked.unkD4) {
entityInfo->linked.linkedStatus = 0;
}
@ -635,7 +635,7 @@ void TickStatusHeal(Entity *entity)
return;
sub_805229C();
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
// HP heal
if (entityInfo->unk146 == 0 && entityInfo->nonVolatile.nonVolatileStatus != STATUS_POISONED && entityInfo->nonVolatile.nonVolatileStatus != STATUS_BADLY_POISONED) {
@ -790,7 +790,7 @@ void TickStatusHeal(Entity *entity)
}
}
if (spdChange) {
s32 oldSpdStage = entity->axObj.info->speedStage;
s32 oldSpdStage = GetEntInfo(entity)->speedStage;
s32 newSpdStage = CalcSpeedStage(entity);
if (oldSpdStage != newSpdStage) {
@ -803,7 +803,7 @@ void TickStatusHeal(Entity *entity)
void sub_8074FB0(Entity *entity, s32 a1, Position *pos)
{
Unk_Entity_x184 *strPtr;
EntityInfo *entityInfo = entity->axObj.info;
EntityInfo *entityInfo = GetEntInfo(entity);
if (entityInfo->numMoveTiles > 3) {
entityInfo->action.action = 0;
@ -999,7 +999,7 @@ bool8 UseAttack(Entity *a0)
monPosBefore = mon->pos;
// Statement with no effect needed to match.
mon->axObj.info->isTeamLeader = mon->axObj.info->isTeamLeader;
GetEntInfo(mon)->isTeamLeader = GetEntInfo(mon)->isTeamLeader;
if (monInfo->flags & 0x2000) {
monInfo->flags &= ~(0x2000);

View File

@ -31,7 +31,7 @@ void sub_8075680(void)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
entity = gDungeon->allPokemon[index];
if ((EntityExists(entity)) && (info = entity->axObj.info, !info->isTeamLeader)) {
if ((EntityExists(entity)) && (info = GetEntInfo(entity), !info->isTeamLeader)) {
targetPos = &(info->targetPos);
if (targetPos->x == 0 && targetPos->y == 0)
@ -62,7 +62,7 @@ void sub_8075708(Entity *entity)
Entity *trap;
EntityInfo *info;
info = entity->axObj.info;
info = GetEntInfo(entity);
if (!EntityExists(entity)) {
return;
}
@ -129,7 +129,7 @@ u32 sub_8075818(Entity *entity)
Trap *trapData; // TODO: turn into struct when more research is done..
u8 r1;
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
if(EntityExists(entity))
{
tile = GetTileAtEntitySafe(entity);

View File

@ -217,7 +217,7 @@ void MuzzleTarget(Entity *pokemon, Entity *target)
EntityInfo *entityInfo;
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->muzzled.muzzled != TRUE) {
entityInfo->muzzled.muzzled = TRUE;
@ -247,7 +247,7 @@ void TransformStatusTarget(Entity * pokemon, Entity * target)
if (!EntityExists(target))
return;
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED)
TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF04);
@ -292,13 +292,11 @@ void TransformStatusTarget(Entity * pokemon, Entity * target)
void MobileStatusTarget(Entity * pokemon, Entity * target)
{
EntityInfo *entityInfo_1;
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo_1 = target->axObj.info;
entityInfo = entityInfo_1;
entityInfo = GetEntInfo(target);
if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) {
SendTransformEndMessage(pokemon,target);
@ -331,7 +329,7 @@ void ExposeStatusTarget(Entity * pokemon, Entity * target, s16 param_3)
flag2 = FALSE;
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->hitChanceStages[1] > 10) {
entityInfo->hitChanceStages[1] = 10;
@ -368,7 +366,7 @@ void IdentityItemHolders(Entity *pokemon, Entity *target)
EntityInfo *entityInfo;
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if (!gDungeon->itemHoldersIdentified) {
nullsub_89(target);
gDungeon->itemHoldersIdentified = TRUE;
@ -387,7 +385,7 @@ void BlindTarget(Entity *pokemon, Entity *target)
EntityInfo *entityInfo;
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->eyesightStatus.eyesightStatus != STATUS_BLINKER) {
entityInfo->eyesightStatus.eyesightStatus = STATUS_BLINKER;
@ -414,7 +412,7 @@ void CrossEyeVisionTarget(Entity *pokemon, Entity *target)
if (EntityExists(target)) {
if(!HasSafeguardStatus(pokemon, target, TRUE))
{
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->eyesightStatus.eyesightStatus != STATUS_CROSS_EYED) {
sub_8041E1C(target);
@ -440,7 +438,7 @@ void RestoreVisionTarget(Entity *pokemon, Entity *target)
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->eyesightStatus.eyesightStatus != STATUS_EYEDROPS) {
entityInfo->eyesightStatus.eyesightStatus = STATUS_EYEDROPS;
@ -471,7 +469,7 @@ void RestorePPTarget(Entity * pokemon,Entity * target, s32 param_3)
PPChanged = FALSE;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
for(index = 0; index < MAX_MON_MOVES; index++)
{
@ -625,7 +623,7 @@ void LongTossStatusTarget(Entity * pokemon, Entity * target)
{
EntityInfo *entityInfo;
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gUnknown_202DFE8,target,0);
if (entityInfo->itemStatus.itemStatus != STATUS_LONG_TOSS) {
entityInfo->itemStatus.itemStatus = STATUS_LONG_TOSS;
@ -642,7 +640,7 @@ void PierceStatusTarget(Entity * pokemon, Entity * target)
{
EntityInfo *entityInfo;
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gUnknown_202DFE8,target,0);
if (entityInfo->itemStatus.itemStatus != STATUS_PIERCE) {
entityInfo->itemStatus.itemStatus = STATUS_PIERCE;
@ -666,7 +664,7 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move *
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if ((entityInfo->charging.chargingStatus == newStatus) && (newStatus == STATUS_ENRAGED)) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC074);
@ -726,7 +724,7 @@ void sub_8079764(Entity * pokemon)
EntityInfo *entityInfo;
if (EntityExists(pokemon)) {
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
if ((entityInfo->charging.chargingStatus != STATUS_BIDE) && (entityInfo->charging.chargingStatus != STATUS_ENRAGED)) {
entityInfo->charging.chargingStatus = STATUS_NONE;
entityInfo->unk14A = 0;
@ -741,7 +739,7 @@ void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->protection.protectionStatus == newStatus) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB10C);
@ -763,7 +761,7 @@ void SafeguardStatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->protection.protectionStatus != STATUS_SAFEGUARD) {
entityInfo->protection.protectionStatus = STATUS_SAFEGUARD;
@ -783,7 +781,7 @@ void MistStatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->protection.protectionStatus != STATUS_MIST) {
entityInfo->protection.protectionStatus = STATUS_MIST;
@ -803,7 +801,7 @@ void WishStatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->protection.protectionStatus != STATUS_WISH) {
entityInfo->protection.protectionStatus = STATUS_WISH;
@ -823,7 +821,7 @@ void MagicCoatStatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->protection.protectionStatus != STATUS_MAGIC_COAT) {
entityInfo->protection.protectionStatus = STATUS_MAGIC_COAT;
@ -843,7 +841,7 @@ void LightScreenStatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->protection.protectionStatus != STATUS_LIGHT_SCREEN) {
entityInfo->protection.protectionStatus = STATUS_LIGHT_SCREEN;
@ -863,7 +861,7 @@ void ReflectStatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->protection.protectionStatus != STATUS_REFLECT) {
entityInfo->protection.protectionStatus = STATUS_REFLECT;
@ -884,7 +882,7 @@ void ProtectStatusTarget(Entity * pokemon, Entity * target)
if (EntityExists(target)) {
nullsub_63(target);
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if (entityInfo->protection.protectionStatus != STATUS_PROTECT) {
entityInfo->protection.protectionStatus = STATUS_PROTECT;
entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4ED4, FALSE) + 1;
@ -904,7 +902,7 @@ void MirrorCoatStatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->protection.protectionStatus != STATUS_MIRROR_COAT) {
entityInfo->protection.protectionStatus = STATUS_MIRROR_COAT;
@ -924,7 +922,7 @@ void EndureStatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->protection.protectionStatus != STATUS_ENDURING) {
entityInfo->protection.protectionStatus = STATUS_ENDURING;
@ -944,7 +942,7 @@ void MirrorMoveStatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->protection.protectionStatus != STATUS_MIRROR_MOVE) {
entityInfo->protection.protectionStatus = STATUS_MIRROR_MOVE;
@ -964,7 +962,7 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if(HasAbility(target, ABILITY_FORECAST))
TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsConversion2Message);
@ -990,7 +988,7 @@ void VitalThrowStatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->protection.protectionStatus != STATUS_VITAL_THROW) {
entityInfo->protection.protectionStatus = STATUS_VITAL_THROW;
@ -1013,7 +1011,7 @@ void sub_8079E34(Entity * pokemon, Entity * target, bool8 param_3)
statChanged = FALSE;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
for(index = 0; index < 2; index++)
{
@ -1067,7 +1065,7 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4)
bVar8 = FALSE;
moveUnsealed = FALSE;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if (HasNegativeStatus(target)) {
bVar8 = TRUE;
SendSleepEndMessage(pokemon,target,0,0);
@ -1135,7 +1133,7 @@ void sub_807A0CC(Entity * pokemon, Entity * target)
s32 index;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
sub_806BFC0(entityInfo,0);
entityInfo->perishSongTurns = 0;
entityInfo->exposed = FALSE;
@ -1160,7 +1158,7 @@ void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8
if (!EntityExists(target)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
switch(entityInfo->sleep.sleep) {
case STATUS_NONE:
@ -1210,7 +1208,7 @@ void SendNonVolatileEndMessage(Entity * pokemon, Entity * target)
if (!EntityExists(target)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
switch(entityInfo->nonVolatile.nonVolatileStatus) {
case STATUS_NONE:
@ -1241,7 +1239,7 @@ void SendImmobilizeEndMessage(Entity * pokemon, Entity *target)
if (!EntityExists(target)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
switch(entityInfo->immobilize.immobilizeStatus) {
case STATUS_NONE:
@ -1281,7 +1279,7 @@ void SendVolatileEndMessage(Entity * pokemon, Entity *target)
if (!EntityExists(target)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
switch(entityInfo->volatileStatus.volatileStatus) {
case STATUS_NONE:
@ -1321,7 +1319,7 @@ void SendProtectionEndMessage(Entity * pokemon, Entity *target)
if (!EntityExists(target)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
switch(entityInfo->protection.protectionStatus) {
case STATUS_NONE:
@ -1378,7 +1376,7 @@ void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
switch(entityInfo->waitingStruct.waitingStatus) {
case STATUS_NONE:
@ -1417,7 +1415,7 @@ void SendLinkedEndMessage(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
switch(entityInfo->linked.linkedStatus)
{
@ -1443,7 +1441,7 @@ void SendMoveEndMessage(Entity * pokemon, Entity * target)
if (!EntityExists(target)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
switch(entityInfo->moveStatus.moveStatus) {
case STATUS_NONE:
@ -1476,7 +1474,7 @@ void SendTransformEndMessage(Entity * pokemon, Entity *target)
if (!EntityExists(target)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
switch(entityInfo->transformStatus.transformStatus) {
case STATUS_NONE:
@ -1511,7 +1509,7 @@ void SendEyesightEndMessage(Entity * pokemon,Entity * target)
if (!EntityExists(target)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
switch(entityInfo->eyesightStatus.eyesightStatus) {
case STATUS_NONE:
@ -1543,7 +1541,7 @@ void SendMuzzledEndMessage(Entity * pokemon, Entity * target)
if (!EntityExists(target)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
switch(entityInfo->muzzled.muzzled) {
case FALSE:
@ -1577,7 +1575,7 @@ void WakeUpPokemon(Entity * pokemon)
{
EntityInfo *entityInfo;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
entityInfo->sleep.sleep = STATUS_NONE;
entityInfo->sleep.sleepTurns = 0;
sub_806A898(pokemon, 1, 1);
@ -1589,7 +1587,7 @@ void SendThawedMessage(Entity *pokemon, Entity *target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if (entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) {
entityInfo->immobilize.immobilizeStatus = STATUS_NONE;
entityInfo->immobilize.immobilizeStatusTurns = 0;
@ -1618,7 +1616,7 @@ void sub_807AA30(void)
{
wildEntity = gDungeon->wildPokemon[wildIndex];
if (EntityExists(wildEntity) &&
(entityInfo = wildEntity->axObj.info, entityInfo->sleep.sleep == STATUS_SLEEP) &&
(entityInfo = GetEntInfo(wildEntity), entityInfo->sleep.sleep == STATUS_SLEEP) &&
(entityInfo->sleep.sleepTurns == 0x7F)) {
adjacentCheck = FALSE;
forceWakeup = FALSE;

View File

@ -82,7 +82,7 @@ void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction)
}
else
{
(target->axObj.info->action).direction = (direction + 4) & DIRECTION_MASK;
(GetEntInfo(target)->action).direction = (direction + 4) & DIRECTION_MASK;
sub_806CDD4(target, 6, (direction + 4) & DIRECTION_MASK);
sub_80421C0(target,0x1a3);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F8A0C); // {POKEMON_0} was blown away!
@ -151,7 +151,7 @@ void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction)
return;
}
sub_806CE68(target,8);
if (target->axObj.info->isTeamLeader) {
if (GetEntInfo(target)->isTeamLeader) {
gDungeon->unk1 = 0;
gDungeon->unk5C0 = -1;
sub_804AC20(&target->pos);
@ -224,7 +224,7 @@ void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, Position *pos)
Position pos2;
bool8 flag;
info = target->axObj.info;
info = GetEntInfo(target);
flag = FALSE;
SetMessageArgument(gAvailablePokemonNames,target,0);

View File

@ -44,7 +44,7 @@ void sub_807E1A0(Entity *pokemon,Entity *target,u8 moveType,s16 param_4,s32 para
param_4_s32 = param_4;
if (EntityExists(target)) {
targetInfo = target->axObj.info;
targetInfo = GetEntInfo(target);
InitPokemonMove(&move, MOVE_REGULAR_ATTACK);
if (!sub_80571F0(target,&move)) {
if (!targetInfo->isNotTeamMember) {
@ -97,7 +97,7 @@ void sub_807E254(Entity *pokemon,Entity *target)
sub_804535C(target,NULL);
if (EntityExists(pokemon)) {
if (pokemon->axObj.info->isTeamLeader) {
if (GetEntInfo(pokemon)->isTeamLeader) {
sub_804AC20(&pokemon->pos);
sub_807EC28(FALSE);
}
@ -106,7 +106,7 @@ void sub_807E254(Entity *pokemon,Entity *target)
}
if (EntityExists(target)) {
if (target->axObj.info->isTeamLeader) {
if (GetEntInfo(target)->isTeamLeader) {
sub_804AC20(&target->pos);
sub_807EC28(FALSE);
}

View File

@ -31,7 +31,7 @@ void sub_8082B40(void)
{
entity = gDungeon->allPokemon[index];
if (EntityExists(entity)) {
info = entity->axObj.info;
info = GetEntInfo(entity);
entity->axObj.spriteFile = GetSpriteData(info->apparentID);
sub_806CCB4(entity,sub_806CEBC(entity));
pos = entity->pos;

View File

@ -115,7 +115,7 @@ bool8 sub_80860A8(u8 id)
for(index = 0; index < MAX_TEAM_MEMBERS; index++)
{
entity = gDungeon->teamPokemon[index];
if (((EntityExists(entity)) && (info = entity->axObj.info, ((info->heldItem).flags & 1))) && ((info->heldItem).id == id)) return TRUE;
if (((EntityExists(entity)) && (info = GetEntInfo(entity), ((info->heldItem).flags & 1))) && ((info->heldItem).id == id)) return TRUE;
}
return FALSE;
}

View File

@ -27,7 +27,7 @@ void sub_8052FB8(const u8 *);
void sub_8086124(Entity *entity, u8 param_2)
{
entity->axObj.info->unk160 = param_2;
GetEntInfo(entity)->unk160 = param_2;
}
void sub_8086130(void)
@ -55,7 +55,7 @@ void sub_80861B8(Entity *a0, u8 r1, s32 direction)
{
EntityInfo *info;
info = a0->axObj.info;
info = GetEntInfo(a0);
sub_806CDD4(a0, r1, direction);
info->unkFE = r1;
@ -69,7 +69,7 @@ void sub_80861D4(Entity *a0, u8 r1, s32 direction)
void sub_80861EC(Entity *a0)
{
a0->axObj.info->unkFE = 0x63;
GetEntInfo(a0)->unkFE = 0x63;
}
s32 sub_80861F8(s16 param_1,Entity *param_2,bool32 param_3)
@ -91,7 +91,7 @@ s32 sub_80861F8(s16 param_1,Entity *param_2,bool32 param_3)
sub_800EE5C(param_1);
sub_800EF64();
sub_803E46C(0x46);
info = param_2->axObj.info;
info = GetEntInfo(param_2);
pos.x = 0;
pos.y = 0;
uStack_38 = sub_800E700(param_1_s32);

View File

@ -425,14 +425,14 @@ void sub_8086854(void)
void sub_80868F4(Entity *entity)
{
entity->axObj.info->unk15C = 1;
entity->axObj.info->unk15D = 1;
GetEntInfo(entity)->unk15C = 1;
GetEntInfo(entity)->unk15D = 1;
}
void sub_8086910(Entity *entity)
{
entity->axObj.info->unk15C = 0;
entity->axObj.info->unk15D = 0;
GetEntInfo(entity)->unk15C = 0;
GetEntInfo(entity)->unk15D = 0;
}
void sub_808692C(void)
@ -455,7 +455,7 @@ void SpriteLookAroundEffect(Entity *entity)
s8 r4;
s8 r3;
r4 = sub_8002984(entity->axObj.info->action.direction, 4);
r4 = sub_8002984(GetEntInfo(entity)->action.direction, 4);
sub_80869E4(entity, 4, 2, r4);
@ -483,7 +483,7 @@ void sub_80869E4(Entity *a0, s32 a1, u8 a2, s8 a3)
tmp = (s8)a3;
info = a0->axObj.info;
info = GetEntInfo(a0);
r4 = (s8)info->action.direction;
while (r4 != tmp) {
r4 = sub_8002A70(r4, tmp, a2);

View File

@ -53,7 +53,7 @@ void sub_8044820(void)
entity = gDungeon->wildPokemon[index];
if (EntityExists(entity)) {
if (sub_8044B28()) break;
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
gDungeon->unkB8 = entity;
TriggerWeatherAbilities();
if ((entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY) == 0) {
@ -88,7 +88,7 @@ void sub_8044820(void)
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
{
entity2 = gDungeon->wildPokemon[index];
if ((EntityExists(entity2)) && (entityInfo2 = entity2->axObj.info, entityInfo2->aiNextToTarget))
if ((EntityExists(entity2)) && (entityInfo2 = GetEntInfo(entity2), entityInfo2->aiNextToTarget))
{
sub_8074094(entity2);
if (EntityExists(entity2)) {
@ -103,7 +103,6 @@ void sub_8044820(void)
void TrySpawnMonsterAndActivatePlusMinus(void)
{
EntityInfo * entityInfo;
EntityInfo * entityInfo2;
Entity *entity;
u32 isNotEnemy;
s32 index;
@ -121,8 +120,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void)
{
entity = gDungeon->allPokemon[index];
if (EntityExists(entity)) {
entityInfo = entity->axObj.info;
entityInfo2 = entityInfo;
entityInfo = GetEntInfo(entity);
entityInfo->attacking = FALSE;
if(entityInfo->isNotTeamMember)
@ -135,7 +133,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void)
if (HasAbility(entity, ABILITY_LIGHTNINGROD)) {
gDungeon->lightningRodPokemon = entity;
gDungeon->unk17B38 = entityInfo2->unk98;
gDungeon->unk17B38 = entityInfo->unk98;
}
if (HasAbility(entity, ABILITY_MINUS)) {
gDungeon->minusIsActive[isNotEnemy] = TRUE;

View File

@ -48,7 +48,7 @@ void sub_8075900(Entity *pokemon, u8 r1)
{
if(EntityExists(pokemon))
{
if(!pokemon->axObj.info->isNotTeamMember)
if(!GetEntInfo(pokemon)->isNotTeamMember)
{
if(!sub_8044B28())
{
@ -72,7 +72,7 @@ void sub_8075900(Entity *pokemon, u8 r1)
void RunMonsterAI(Entity *pokemon, u32 unused)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
if (pokemonInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY)
{
if (pokemonInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED)
@ -110,10 +110,10 @@ void RunMonsterAI(Entity *pokemon, u32 unused)
{
target = gDungeon->allPokemon[i];
if (EntityExists(target) &&
target->axObj.info->waitingStruct.waitingStatus == STATUS_DECOY &&
GetEntInfo(target)->waitingStruct.waitingStatus == STATUS_DECOY &&
CanSeeTarget(pokemon, target))
{
bool8 enemyDecoy = target->axObj.info->waitingStruct.enemyDecoy;
bool8 enemyDecoy = GetEntInfo(target)->waitingStruct.enemyDecoy;
u8 targetingDecoy = TARGETING_DECOY_TEAM;
if (enemyDecoy)
{

View File

@ -70,7 +70,7 @@ extern void sub_806A5B8(struct Entity *entity);
void DecideAttack(Entity *pokemon)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
s32 i;
s32 chargeStatus = STATUS_CHARGING;
struct AIPossibleMove aiPossibleMove[MAX_MON_MOVES + 1];
@ -360,7 +360,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move
{
s32 targetingFlags;
s32 moveWeight = 1;
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
s32 numPotentialTargets = 0;
s32 i;
bool8 hasStatusChecker;
@ -619,7 +619,7 @@ s32 TryAddTargetToAITargetList(s32 numPotentialTargets, s32 targetingFlags, Enti
s32 direction;
s32 targetingFlags2 = (s16) targetingFlags;
bool8 hasStatusChecker2 = hasStatusChecker;
EntityInfo *userData = user->axObj.info;
EntityInfo *userData = GetEntInfo(user);
if ((user->pos.x == target->pos.x && user->pos.y == target->pos.y) ||
(targetingFlags2 & 0xF0) == TARGETING_FLAG_TARGET_ROOM ||
(targetingFlags2 & 0xF0) == TARGETING_FLAG_TARGET_FLOOR ||
@ -664,12 +664,12 @@ bool8 IsAITargetEligible(s32 targetingFlags, Entity *user, Entity *target, Move
}
else if (categoryTargetingFlags == TARGETING_FLAG_LONG_RANGE)
{
targetData = target->axObj.info;
targetData = GetEntInfo(target);
goto checkThirdParty;
}
else if (categoryTargetingFlags == TARGETING_FLAG_ATTACK_ALL)
{
targetData = target->axObj.info;
targetData = GetEntInfo(target);
if (user == target)
{
goto returnFalse;
@ -739,7 +739,7 @@ bool8 IsAITargetEligible(s32 targetingFlags, Entity *user, Entity *target, Move
}
else if ((targetingFlags2 & 0xF00) == TARGETING_FLAG_EXPOSE)
{
targetData = target->axObj.info;
targetData = GetEntInfo(target);
if ((targetData->types[0] != TYPE_GHOST && targetData->types[1] != TYPE_GHOST) || targetData->exposed)
{
if (*categoryTargetingFlags2); // Flips the conditional.
@ -780,7 +780,7 @@ s32 WeightMove(Entity *user, s32 targetingFlags, Entity *target, u32 moveType)
u8 moveType2 = moveType;
u8 weight = 1;
EntityInfo *targetData2;
targetData2 = targetData = target->axObj.info;
targetData2 = targetData = GetEntInfo(target);
if (!targetData->isNotTeamMember || (targetingFlags2 & 0xF) != TARGETING_FLAG_TARGET_OTHER)
{
return 1;
@ -809,7 +809,7 @@ s32 WeightMove(Entity *user, s32 targetingFlags, Entity *target, u32 moveType)
bool8 TargetRegularAttack(Entity *pokemon, u32 *targetDir, bool8 checkPetrified)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
s32 numPotentialTargets = 0;
s32 direction = pokemonInfo->action.direction;
s32 faceTurnLimit = pokemonInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER ? 1 : 8;
@ -828,7 +828,7 @@ bool8 TargetRegularAttack(Entity *pokemon, u32 *targetDir, bool8 checkPetrified)
GetEntityType(target) == ENTITY_MONSTER &&
CanAttackInDirection(pokemon, direction) &&
GetTreatmentBetweenMonsters(pokemon, target, FALSE, checkPetrified) == TREATMENT_TREAT_AS_ENEMY &&
(!hasStatusChecker || target->axObj.info->immobilize.immobilizeStatus != STATUS_FROZEN))
(!hasStatusChecker || GetEntInfo(target)->immobilize.immobilizeStatus != STATUS_FROZEN))
{
potentialAttackTargetDirections[numPotentialTargets] = direction;
potentialAttackTargetWeights[numPotentialTargets] = WeightMove(pokemon, TARGETING_FLAG_TARGET_OTHER, target, TYPE_NONE);
@ -960,7 +960,7 @@ void HandleUseMoveAIAction(Entity *target)
while (TRUE) {
if (counter >= sub_8070828(target, TRUE))
break;
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
sub_8055A00(target, entityInfo->action.unk4[0].actionUseIndex, 1, 0, 0);
if (!EntityExists(target))
break;
@ -973,7 +973,7 @@ void HandleUseMoveAIAction(Entity *target)
sub_8057588(target, 1);
if (EntityExists(target))
sub_806A9B4(target, target->axObj.info->action.unk4[0].actionUseIndex);
sub_806A9B4(target, GetEntInfo(target)->action.unk4[0].actionUseIndex);
sub_806A1B0(target);
}
@ -989,7 +989,7 @@ void HandleUseOrbAction(Entity *pokemon)
struct AIPossibleMove sp28;
bool8 r8;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
item = sub_8044D90(pokemon, 0, 21);
IVar5 = *item;

View File

@ -13,7 +13,7 @@
u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFlags)
{
EntityInfo *pokemonInfo = targetPokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(targetPokemon);
s32 itemWeight = 0;
bool8 targetOther = itemTargetFlags & 1;
u16 targetAlly = (itemTargetFlags >> 1) & 1;
@ -185,7 +185,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla
}
break;
case ITEM_QUICK_SEED:
if (targetPokemon->axObj.info->speedStage < MAX_SPEED_STAGE)
if (GetEntInfo(targetPokemon)->speedStage < MAX_SPEED_STAGE)
{
if (IsAdjacentToEnemy(targetPokemon))
{

View File

@ -52,9 +52,9 @@ void sub_807360C(void)
entity = gDungeon->allPokemon[index];
if(EntityExists(entity))
{
if(entity->axObj.info->unk152 != 0)
if(GetEntInfo(entity)->unk152 != 0)
{
entity->axObj.info->unk152 = 0;
GetEntInfo(entity)->unk152 = 0;
UpdateFlashFireBoost(entity, entity);
}
}
@ -63,7 +63,7 @@ void sub_807360C(void)
void AIDecideUseItem(Entity *pokemon)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
void *null;
Item *item;
s32 toolboxIndex;
@ -366,7 +366,7 @@ void TargetThrownItem(Entity *pokemon, Entity *targetPokemon, Item *item, s32 ta
distanceX = distanceX < 0 ? -distanceX : distanceX;
distanceY = pokemon->pos.y - targetPokemon->pos.y;
distanceY = distanceY < 0 ? -distanceY : distanceY;
if (pokemon->axObj.info->itemStatus.itemStatus == STATUS_NONE)
if (GetEntInfo(pokemon)->itemStatus.itemStatus == STATUS_NONE)
{
s32 distance = distanceY < distanceX ? distanceX : distanceY;
if (distance > RANGED_ATTACK_RANGE)

View File

@ -84,20 +84,20 @@ u32 sub_8075818(Entity *entity);
bool8 TargetLeader(Entity *pokemon)
{
if (pokemon->axObj.info->isNotTeamMember)
if (GetEntInfo(pokemon)->isNotTeamMember)
{
return FALSE;
}
return TacticsTargetLeader(pokemon->axObj.info->tactic);
return TacticsTargetLeader(GetEntInfo(pokemon)->tactic);
}
Entity* GetLeaderIfVisible(Entity *pokemon)
{
if (!pokemon->axObj.info->isNotTeamMember)
if (!GetEntInfo(pokemon)->isNotTeamMember)
{
Entity *leader = GetLeader();
if (leader &&
leader->axObj.info->waitingStruct.waitingStatus != STATUS_DECOY &&
GetEntInfo(leader)->waitingStruct.waitingStatus != STATUS_DECOY &&
GetTreatmentBetweenMonsters(pokemon, leader, FALSE, FALSE) == TREATMENT_TREAT_AS_ALLY &&
CanTargetEntity(pokemon, leader))
{
@ -120,7 +120,7 @@ bool8 sub_8072CF4(Entity *entity)
sub_804178C(1);
gUnknown_203B434 = 1;
info = entity->axObj.info;
info = GetEntInfo(entity);
info->useHeldItem = FALSE;
info->unkF3 = FALSE;
gDungeon->unkB8 = entity;
@ -320,8 +320,8 @@ bool8 sub_8072CF4(Entity *entity)
}
sub_807FD84(entity);
if (EntityExists(entity)) {
if (entity->axObj.info->unk14A == 0) {
entity->axObj.info->unk14A = 0;
if (GetEntInfo(entity)->unk14A == 0) {
GetEntInfo(entity)->unk14A = 0;
sub_8079764(entity);
}
sub_8041888(0);

View File

@ -45,7 +45,7 @@ const s32 gFaceDirectionIncrements[] = {0, 1, -1, 2, -2, 3, -3, 4, 0, -1, 1, -2,
void MoveIfPossible(Entity *pokemon, bool8 showRunAwayEffect)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
pokemonInfo->aiTarget.aiNotNextToTarget = FALSE;
pokemonInfo->aiTarget.aiTargetingEnemy = FALSE;
pokemonInfo->aiTarget.aiTurningAround = FALSE;
@ -103,7 +103,7 @@ void MoveIfPossible(Entity *pokemon, bool8 showRunAwayEffect)
bool8 CanTakeItem(Entity *pokemon)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
struct Tile *mapTile;
Entity *object;
if (!EntityExists(pokemon) || CheckVariousConditions(pokemon))
@ -139,7 +139,7 @@ bool8 CanTakeItem(Entity *pokemon)
bool8 ChooseTargetPosition(Entity *pokemon)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
if (!TargetLeader(pokemon))
{
Entity **possibleTargets;
@ -169,7 +169,7 @@ bool8 ChooseTargetPosition(Entity *pokemon)
for (i = 0; i < maxPossibleTargets; i++)
{
Entity *target = possibleTargets[i];
if (EntityExists(target) && target->axObj.info->clientType == CLIENT_TYPE_NONE)
if (EntityExists(target) && GetEntInfo(target)->clientType == CLIENT_TYPE_NONE)
{
if (gDungeon->decoyActive)
{
@ -178,11 +178,11 @@ bool8 ChooseTargetPosition(Entity *pokemon)
continue;
}
}
else if (!pokemonInfo->isNotTeamMember && target->axObj.info->immobilize.immobilizeStatus == STATUS_PETRIFIED)
else if (!pokemonInfo->isNotTeamMember && GetEntInfo(target)->immobilize.immobilizeStatus == STATUS_PETRIFIED)
{
continue;
}
if (target->axObj.info->shopkeeper != SHOPKEEPER_MODE_SHOPKEEPER)
if (GetEntInfo(target)->shopkeeper != SHOPKEEPER_MODE_SHOPKEEPER)
{
s32 currentDistance;
if (canCrossWalls)
@ -330,7 +330,7 @@ bool8 ChooseTargetPosition(Entity *pokemon)
{
if (pokemonInfo->aiTarget.aiTarget->spawnGenID == pokemonInfo->aiTarget.aiTargetSpawnGenID)
{
EntityInfo *targetData = pokemonInfo->aiTarget.aiTarget->axObj.info;
EntityInfo *targetData = GetEntInfo(pokemonInfo->aiTarget.aiTarget);
s32 i;
for (i = 0; i < NUM_PREV_POS; i++)
{
@ -357,7 +357,7 @@ bool8 ChooseTargetPosition(Entity *pokemon)
void DecideMovement(Entity *pokemon, bool8 showRunAwayEffect)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
s32 direction;
s32 turnLimit;
s32 i;
@ -506,7 +506,7 @@ bool8 AvoidEnemies(Entity *pokemon)
u8 closestTargetRoom;
s32 closestTargetDistance = INFINITY_2;
Entity *closestTarget;
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
u8 room = GetEntityRoom(pokemon);
Entity **possibleTargets;
s32 numPossibleTargets;
@ -701,7 +701,7 @@ bool8 AvoidEnemies(Entity *pokemon)
bool8 Wander(Entity *pokemon)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
s32 room = GetEntityRoom(pokemon);
s32 targetFacingDir = 0;
if (room == CORRIDOR_ROOM)
@ -808,7 +808,7 @@ void sub_807BB78(Entity *pokemon)
{
EntityInfo *entityInfo;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
entityInfo->aiTarget.aiObjective = 0;
entityInfo->aiTarget.aiTargetPos = pokemon->pos;
entityInfo->aiTarget.aiTarget = 0;

View File

@ -67,14 +67,14 @@ bool8 sub_8070F3C(Entity * pokemon, Position *pos, s32 direction)
u8 terrain;
struct Tile *tile;
terrain = GetCrossableTerrain(pokemon->axObj.info->id);
terrain = GetCrossableTerrain(GetEntInfo(pokemon)->id);
tile = GetTile(pos->x + gAdjacentTileOffsets[direction].x, pos->y + gAdjacentTileOffsets[direction].y);
if ((!(tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL)) &&
(((tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))))) {
if (!IsCurrentFixedRoomBossFight())
{
if (pokemon->axObj.info->transformStatus.transformStatus == STATUS_MOBILE ||
if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE ||
HasHeldItem(pokemon, ITEM_MOBILE_SCARF))
{
terrain = CROSSABLE_TERRAIN_WALL;
@ -130,14 +130,14 @@ bool8 sub_8070F80(Entity * pokemon, s32 direction)
u8 terrain;
struct Tile *tile;
terrain = GetCrossableTerrain(pokemon->axObj.info->id);
terrain = GetCrossableTerrain(GetEntInfo(pokemon)->id);
tile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, pokemon->pos.y + gAdjacentTileOffsets[direction].y);
if ((!(tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL)) &&
(((tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))))) {
if (!IsCurrentFixedRoomBossFight())
{
if (pokemon->axObj.info->transformStatus.transformStatus == STATUS_MOBILE ||
if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE ||
HasHeldItem(pokemon, ITEM_MOBILE_SCARF))
{
terrain = CROSSABLE_TERRAIN_WALL;
@ -175,15 +175,15 @@ bool8 sub_8071058(Entity * pokemon, s32 direction)
u8 terrain;
struct Tile *tile;
terrain = GetCrossableTerrain(pokemon->axObj.info->id);
terrain = GetCrossableTerrain(GetEntInfo(pokemon)->id);
tile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, pokemon->pos.y + gAdjacentTileOffsets[direction].y);
if ((!(tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL)) &&
(((tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER)) ||
(!tile->monster->axObj.info->isNotTeamMember)))) {
(!GetEntInfo(tile->monster)->isNotTeamMember)))) {
if (!IsCurrentFixedRoomBossFight())
{
if (pokemon->axObj.info->transformStatus.transformStatus == STATUS_MOBILE ||
if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE ||
HasHeldItem(pokemon, ITEM_MOBILE_SCARF))
{
terrain = CROSSABLE_TERRAIN_WALL;
@ -217,7 +217,7 @@ bool8 sub_8071058(Entity * pokemon, s32 direction)
bool8 CanAttackInDirection(Entity *pokemon, s32 direction)
{
u8 crossableTerrain = GetCrossableTerrain(pokemon->axObj.info->id);
u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id);
struct Tile *tile;
if (crossableTerrain < CROSSABLE_TERRAIN_CREVICE)
{
@ -230,7 +230,7 @@ bool8 CanAttackInDirection(Entity *pokemon, s32 direction)
{
if (!IsCurrentFixedRoomBossFight())
{
if (pokemon->axObj.info->transformStatus.transformStatus == STATUS_MOBILE ||
if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE ||
HasHeldItem(pokemon, ITEM_MOBILE_SCARF))
{
crossableTerrain = CROSSABLE_TERRAIN_WALL;
@ -264,7 +264,7 @@ bool8 CanAttackInDirection(Entity *pokemon, s32 direction)
bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemonInFront)
{
u8 crossableTerrain = GetCrossableTerrain(pokemon->axObj.info->id);
u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id);
struct Tile *frontTile, *currentTile;
*pokemonInFront = FALSE;
frontTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x,
@ -282,7 +282,7 @@ bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemon
if (frontTile->object != NULL &&
IQSkillIsEnabled(pokemon, IQ_TRAP_AVOIDER) &&
GetEntityType(frontTile->object) == ENTITY_TRAP &&
(frontTile->object->isVisible || pokemon->axObj.info->eyesightStatus.eyesightStatus == STATUS_EYEDROPS))
(frontTile->object->isVisible || GetEntInfo(pokemon)->eyesightStatus.eyesightStatus == STATUS_EYEDROPS))
{
return FALSE;
}
@ -294,7 +294,7 @@ bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemon
}
if (!IsCurrentFixedRoomBossFight())
{
if (pokemon->axObj.info->transformStatus.transformStatus == STATUS_MOBILE ||
if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE ||
HasHeldItem(pokemon, ITEM_MOBILE_SCARF))
{
crossableTerrain = CROSSABLE_TERRAIN_WALL;
@ -334,10 +334,10 @@ bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemon
bool8 IsAtJunction(Entity *pokemon)
{
u32 crossableTerrain = GetCrossableTerrain(pokemon->axObj.info->id);
u32 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id);
if (!IsCurrentFixedRoomBossFight())
{
if (pokemon->axObj.info->transformStatus.transformStatus == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF))
if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF))
{
crossableTerrain = CROSSABLE_TERRAIN_WALL;
}
@ -352,7 +352,7 @@ bool8 IsAtJunction(Entity *pokemon)
}
if (crossableTerrain == CROSSABLE_TERRAIN_WALL)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
pokemonInfo->mobileTurnTimer += DungeonRandInt(100);
if (pokemonInfo->mobileTurnTimer < 200)
{
@ -409,7 +409,7 @@ bool8 ShouldMonsterRunAway(Entity *pokemon)
}
else
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
if (pokemonInfo->terrifiedTurns != 0)
{
return TRUE;
@ -449,12 +449,10 @@ void CheckRunAwayVisualFlag(Entity *pokemon, bool8 showRunAwayEffect)
{
bool8 cVar1;
EntityInfo *iVar2;
EntityInfo *iVar3;
iVar2 = pokemon->axObj.info;
iVar3 = iVar2;
iVar2 = GetEntInfo(pokemon);
if (((!iVar2->isTeamLeader) && HasAbility(pokemon,ABILITY_RUN_AWAY) &&
(cVar1 = SetVisualFlags(iVar3,4,iVar2->HP <= iVar2->maxHPStat / 2), showRunAwayEffect)) &&
(cVar1 = SetVisualFlags(iVar2,4,iVar2->HP <= iVar2->maxHPStat / 2), showRunAwayEffect)) &&
(cVar1)) {
ShowVisualFlags(pokemon);
}
@ -462,8 +460,8 @@ void CheckRunAwayVisualFlag(Entity *pokemon, bool8 showRunAwayEffect)
u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ignoreInvisible, bool8 checkPetrified)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *targetData = targetPokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
EntityInfo *targetData = GetEntInfo(targetPokemon);
u8 targetingDecoy;
u8 pokemonTargetingDecoy;
bool8 pokemonIsEnemy;
@ -532,8 +530,8 @@ u8 sub_807167C(Entity * pokemon, Entity * target)
EntityInfo * targetEntityInfo;
EntityInfo * pokemonEntityData;
pokemonEntityData = pokemon->axObj.info;
targetEntityInfo = target->axObj.info;
pokemonEntityData = GetEntInfo(pokemon);
targetEntityInfo = GetEntInfo(target);
if (pokemonEntityData->clientType != CLIENT_TYPE_CLIENT) {
cannotUseItems = IsClientOrTeamBase(pokemonEntityData->joinedAt.joinedAt);
if (!cannotUseItems && (pokemonEntityData->shopkeeper == SHOPKEEPER_MODE_NORMAL) && (targetEntityInfo->clientType != CLIENT_TYPE_CLIENT)) {

View File

@ -22,7 +22,7 @@ const u8 gDirectionBitMasks_1[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80};
// These functions could use better names if someone figures out a clear pattern/reasoning.
bool8 CheckVariousStatuses2(Entity *pokemon, bool8 checkBlinker)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = pokemon->axObj.info; // GetEntInfo doesn't work here
if ((checkBlinker && pokemonInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER)
|| pokemonInfo->sleep.sleep == STATUS_SLEEP
@ -41,7 +41,7 @@ bool8 CheckVariousStatuses2(Entity *pokemon, bool8 checkBlinker)
bool8 sub_8070BC0(Entity* entity)
{
EntityInfo *entityInfo = entity->axObj.info;
EntityInfo *entityInfo = GetEntInfo(entity);
if (IsChargingAnyTwoTurnMove(entity, FALSE)
|| entityInfo->sleep.sleep == STATUS_YAWNING
@ -79,7 +79,7 @@ bool8 sub_8070BC0(Entity* entity)
bool8 CheckVariousConditions(Entity *pokemon)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
if (pokemonInfo->clientType == CLIENT_TYPE_CLIENT
|| IsClientOrTeamBase(pokemonInfo->joinedAt.joinedAt)
@ -96,7 +96,7 @@ bool8 CheckVariousConditions(Entity *pokemon)
bool8 CheckVariousStatuses(Entity *pokemon)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = pokemon->axObj.info; // GetEntInfo doesn't work here
if ((pokemonInfo->sleep.sleep != STATUS_SLEEPLESS
&& pokemonInfo->sleep.sleep != STATUS_NONE)
@ -112,7 +112,7 @@ bool8 CheckVariousStatuses(Entity *pokemon)
bool8 CannotAttack(Entity *pokemon, bool8 skipSleep)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
if ((skipSleep ||
pokemonInfo->sleep.sleep == STATUS_SLEEPLESS ||
@ -134,7 +134,7 @@ bool8 CannotAttack(Entity *pokemon, bool8 skipSleep)
bool8 CanMoveInDirection(Entity *pokemon, u32 direction)
{
u8 crossableTerrain = GetCrossableTerrain(pokemon->axObj.info->id);
u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id);
struct Tile *currentMapTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x,
pokemon->pos.y + gAdjacentTileOffsets[direction].y);
@ -143,7 +143,7 @@ bool8 CanMoveInDirection(Entity *pokemon, u32 direction)
if (!IsCurrentFixedRoomBossFight())
{
if (pokemon->axObj.info->transformStatus.transformStatus == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF))
if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF))
crossableTerrain = CROSSABLE_TERRAIN_WALL;
else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER))
crossableTerrain = CROSSABLE_TERRAIN_CREVICE;

View File

@ -462,14 +462,14 @@ void SkarmoryEntry(Entity *);
void sub_8086A3C(Entity *pokemon)
{
pokemon->axObj.info->unk15C = 1;
pokemon->axObj.info->unk15E = 1;
GetEntInfo(pokemon)->unk15C = 1;
GetEntInfo(pokemon)->unk15E = 1;
}
void sub_8086A54(Entity *pokemon)
{
pokemon->axObj.info->unk15C = 1;
pokemon->axObj.info->unk15E = 0;
GetEntInfo(pokemon)->unk15C = 1;
GetEntInfo(pokemon)->unk15E = 0;
}
void SetupBossFightHP(Entity *pokemon, s32 newHP, u16 songIndex)
@ -525,7 +525,7 @@ void sub_8086B14(void)
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
sub_8086A3C(skarmoryEntity);
diglettEntity->axObj.info->unk15C = 1;
GetEntInfo(diglettEntity)->unk15C = 1;
sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 2);
CopyMonsterNametoBuffer(gUnknown_202E038,MONSTER_DIGLETT);
CopyMonsterNametoBuffer(gUnknown_202E038 + 0x50, MONSTER_SKARMORY);
@ -589,7 +589,7 @@ void SkarmoryPreFightDialogue(void)
ShiftCameraToPosition(&pos2,0x30);
DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_2);
sub_803E708(10,0x46);
diglettEntity->axObj.info->unk15D = 1;
GetEntInfo(diglettEntity)->unk15D = 1;
ShiftCameraToPosition(&pos1,0x30);
DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_3); // Diglett: ...I...\nI'm scared.
sub_803E708(10,0x46);
@ -707,7 +707,7 @@ void sub_8086F54(u8 param_1, u8 param_2)
for(index = 0; index < 0x10; index++)
{
entity = gDungeon->wildPokemon[index];
if ((EntityExists(entity)) && (entity->axObj.info->clientType != param_1)) {
if ((EntityExists(entity)) && (GetEntInfo(entity)->clientType != param_1)) {
return;
}
}
@ -811,16 +811,16 @@ void sub_8087144(void)
sub_8086A54(iVar3);
sub_8086A54(iVar4);
sub_8085B4C(auStack_4c,puStack_64,pEStack_58,3);
iVar2->axObj.info->unk15F = 1;
iVar3->axObj.info->unk15F = 1;
iVar4->axObj.info->unk15F = 1;
GetEntInfo(iVar2)->unk15F = 1;
GetEntInfo(iVar3)->unk15F = 1;
GetEntInfo(iVar4)->unk15F = 1;
while( TRUE ) {
if (!sub_8085B80(auStack_4c)) break;
sub_803E46C(0x46);
}
iVar2->axObj.info->unk15F = 0;
iVar3->axObj.info->unk15F = 0;
iVar4->axObj.info->unk15F = 0;
GetEntInfo(iVar2)->unk15F = 0;
GetEntInfo(iVar3)->unk15F = 0;
GetEntInfo(iVar4)->unk15F = 0;
}
void sub_8087230(void)
@ -917,19 +917,19 @@ void ZapdosPreFightDialogue(void)
puStack_34[0] = puStack_38.unk0;
pEStack_34[0] = partnerEntity;
sub_8085B4C(&auStack_78,puStack_34,pEStack_34,1);
partnerEntity->axObj.info->unk15F = 1;
GetEntInfo(partnerEntity)->unk15F = 1;
while(sub_8085B80(&auStack_78)) {
sub_803E46C(0x46);
}
partnerEntity->axObj.info->unk15F = 0;
partnerEntity->axObj.info->unk15D = 1;
GetEntInfo(partnerEntity)->unk15F = 0;
GetEntInfo(partnerEntity)->unk15D = 1;
sub_80869E4(partnerEntity,2,2,DIRECTION_NORTH);
DisplayDungeonDialogue(&gUnknown_81015E8); // I warned you! I have no mercy for meddlers
sub_803E708(0x3c,0x46);
DisplayDungeonDialogue(&gUnknown_8101624);
sub_803E708(10,0x46);
partnerEntity->axObj.info->unk15D = 0;
GetEntInfo(partnerEntity)->unk15D = 0;
sub_80869E4(partnerEntity,2,2,DIRECTION_NORTHWEST);
puStack_30 = gUnknown_8107464;
@ -1015,13 +1015,13 @@ void ZapdosDropInEffect(Entity *zapdosEntity)
{
int iVar1;
zapdosEntity->axObj.info->unk15C = 1;
zapdosEntity->axObj.info->unk15E = 0;
zapdosEntity->axObj.info->unk174 = 200;
GetEntInfo(zapdosEntity)->unk15C = 1;
GetEntInfo(zapdosEntity)->unk15E = 0;
GetEntInfo(zapdosEntity)->unk174 = 200;
PlaySoundEffect(0x1ea);
for(iVar1 = 200; iVar1 >= 0; iVar1 -= 5)
{
zapdosEntity->axObj.info->unk174 = iVar1 * 256;
GetEntInfo(zapdosEntity)->unk174 = iVar1 * 256;
sub_803E46C(0x46);
}
sub_803E708(0x1e,0x46);
@ -1264,13 +1264,13 @@ void MoltresDropInEffect(Entity * moltresEntity)
{
s32 iVar1;
moltresEntity->axObj.info->unk15C = 1;
moltresEntity->axObj.info->unk15E = 0;
moltresEntity->axObj.info->unk174 = 0xc800;
GetEntInfo(moltresEntity)->unk15C = 1;
GetEntInfo(moltresEntity)->unk15E = 0;
GetEntInfo(moltresEntity)->unk174 = 0xc800;
PlaySoundEffect(0x1f8);
for(iVar1 = 200; iVar1 >= 0; iVar1 -= 5)
{
moltresEntity->axObj.info->unk174 = iVar1 * 256;
GetEntInfo(moltresEntity)->unk174 = iVar1 * 256;
sub_803E46C(0x46);
}
}
@ -1667,12 +1667,12 @@ void sub_8088484(Entity *param_1)
{
int iVar1;
param_1->axObj.info->unk15C = 1;
param_1->axObj.info->unk15E = 0;
GetEntInfo(param_1)->unk15C = 1;
GetEntInfo(param_1)->unk15E = 0;
PlaySoundEffect(0x1ea);
for(iVar1 = 250; iVar1 >= 0; iVar1 -= 5)
{
param_1->axObj.info->unk174 = iVar1 * 256;
GetEntInfo(param_1)->unk174 = iVar1 * 256;
SetDungeonBGColorRGB(iVar1,iVar1,iVar1 / 2,1,0);
sub_803E46C(0x46);
}
@ -2177,8 +2177,8 @@ void MagmaCavernMidDialogue(void)
// Hey! {POKEMON_0}!
// Over there!
DisplayDungeonDialogue(&MagmaCavernMidDialogue_5);
groudonEntity->axObj.info->unk15E = 0;
alakazamEntity->axObj.info->unk15E =0;
GetEntInfo(groudonEntity)->unk15E = 0;
GetEntInfo(alakazamEntity)->unk15E =0;
pos.x = (groudonEntity->pixelPos.x + alakazamEntity->pixelPos.x) / 2;
pos.y = (groudonEntity->pixelPos.y + alakazamEntity->pixelPos.y) / 2 + 0x800;
ShiftCameraToPosition(&pos,0x20);
@ -2261,14 +2261,14 @@ void sub_808919C(Entity *r0)
void sub_80891B0(Entity *r0)
{
sub_806CDD4(r0, 0, DIRECTION_NORTH);
r0->axObj.info->unk15F = 1;
GetEntInfo(r0)->unk15F = 1;
}
void sub_80891D0(Entity *r0)
{
sub_806CDD4(r0, 7, DIRECTION_NORTH);
r0->axObj.info->unk15F = 0;
GetEntInfo(r0)->unk15F = 0;
}
void sub_80891F0(void)
@ -2484,7 +2484,7 @@ void RayquazaDropInEffect(Entity *rayquazaEntity)
s32 iVar1;
s32 iVar2;
rayquazaEntity->axObj.info->unk15E = 0;
GetEntInfo(rayquazaEntity)->unk15E = 0;
iVar2 = 51200;
iVar1 = 0x600;
PlaySoundEffect(0x1f8);
@ -2495,10 +2495,10 @@ void RayquazaDropInEffect(Entity *rayquazaEntity)
iVar1 = 0x14;
}
if (iVar2 < 0) break;
rayquazaEntity->axObj.info->unk174 = iVar2;
GetEntInfo(rayquazaEntity)->unk174 = iVar2;
sub_803E46C(0x46);
}
rayquazaEntity->axObj.info->unk174 = 0;
GetEntInfo(rayquazaEntity)->unk174 = 0;
}
void RayquazaScreenFlash(void)
@ -2565,7 +2565,7 @@ void sub_8089788(Entity *entity, u8 param_2, u8 param_3)
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
{
monEntity = gDungeon->wildPokemon[index];
if ((EntityExists(monEntity)) && (monEntity != entity) && (monEntity->axObj.info->clientType == param_2)) {
if ((EntityExists(monEntity)) && (monEntity != entity) && (GetEntInfo(monEntity)->clientType == param_2)) {
return;
}
}
@ -2757,7 +2757,7 @@ void MewtwoDropInEffect(Entity *mewtwoEntity)
s32 iVar1;
s32 iVar2;
mewtwoEntity->axObj.info->unk15E = 0;
GetEntInfo(mewtwoEntity)->unk15E = 0;
iVar2 = 51200;
iVar1 = 0x400;
PlaySoundEffect(0x1f8);
@ -2768,10 +2768,10 @@ void MewtwoDropInEffect(Entity *mewtwoEntity)
iVar1 = 0x1e;
}
if (iVar2 < 0) break;
mewtwoEntity->axObj.info->unk174 = iVar2;
GetEntInfo(mewtwoEntity)->unk174 = iVar2;
sub_803E46C(0x46);
}
mewtwoEntity->axObj.info->unk174 = 0;
GetEntInfo(mewtwoEntity)->unk174 = 0;
}
void MewtwoScreenFlash(void)
@ -3216,7 +3216,7 @@ void sub_808A528(Entity * param_1)
s32 iVar1;
s32 iVar2;
param_1->axObj.info->unk15E = 0;
GetEntInfo(param_1)->unk15E = 0;
iVar2 = 51200;
iVar1 = 3072;
PlaySoundEffect(0x1f8);
@ -3227,10 +3227,10 @@ void sub_808A528(Entity * param_1)
iVar1 = 20;
}
if (iVar2 < 0) break;
param_1->axObj.info->unk174 = iVar2;
GetEntInfo(param_1)->unk174 = iVar2;
sub_803E46C(70);
}
param_1->axObj.info->unk174 = 0;
GetEntInfo(param_1)->unk174 = 0;
}
void SuicuneScreenFlash(void)
@ -3394,7 +3394,7 @@ void HoOhDropInEffect(Entity * param_1)
s32 iVar1;
s32 iVar2;
param_1->axObj.info->unk15E = 0;
GetEntInfo(param_1)->unk15E = 0;
iVar2 = 51200;
iVar1 = 3072;
PlaySoundEffect(0x1f8);
@ -3405,10 +3405,10 @@ void HoOhDropInEffect(Entity * param_1)
iVar1 = 20;
}
if (iVar2 < 0) break;
param_1->axObj.info->unk174 = iVar2;
GetEntInfo(param_1)->unk174 = iVar2;
sub_803E46C(70);
}
param_1->axObj.info->unk174 = 0;
GetEntInfo(param_1)->unk174 = 0;
}
void HoOhScreenFlash(void)
@ -3845,7 +3845,7 @@ void sub_808B1CC(u8 itemID)
void SetupRegiFacingDirection(Entity *regiEntity)
{
regiEntity->axObj.info->action.direction = DIRECTION_NORTH;
GetEntInfo(regiEntity)->action.direction = DIRECTION_NORTH;
sub_806CE68(regiEntity, DIRECTION_NORTH);
}
@ -3972,8 +3972,8 @@ void sub_808B50C(void)
sub_80855E4(sub_808BBA8);
sub_808BBA8(jirachiEntity);
sub_8041888(0);
jirachiEntity->axObj.info->unk15C = 1;
jirachiEntity->axObj.info->unk15E = 0;
GetEntInfo(jirachiEntity)->unk15C = 1;
GetEntInfo(jirachiEntity)->unk15E = 0;
sub_80861B8(jirachiEntity,0xe,DIRECTION_SOUTH);
DungeonFadeOutBGM(0x1e);
sub_803E708(0x1e,70);
@ -4013,8 +4013,8 @@ void JirachiWish(void)
sub_80855E4(sub_808BBA8);
sub_808BBA8(jirachiEntity);
sub_8041888(0);
jirachiEntity->axObj.info->unk15C = 1;
jirachiEntity->axObj.info->unk15E = 0;
GetEntInfo(jirachiEntity)->unk15C = 1;
GetEntInfo(jirachiEntity)->unk15E = 0;
sub_80861B8(jirachiEntity,0xe,DIRECTION_SOUTH);
sub_80855E4(sub_80861A8);
gDungeon->unk1356C = 1;
@ -4069,7 +4069,7 @@ void JirachiWish(void)
sub_8046860(jirachiEntity,&pos1,auStack152,9);
}
}
jirachiEntity->axObj.info->unk15D = 0;
GetEntInfo(jirachiEntity)->unk15D = 0;
}
if (wishChoice == 2) {
// Lots of Items
@ -4080,7 +4080,7 @@ void JirachiWish(void)
for(counter = 0; counter < 6; counter++)
{
#ifndef NONMATCHING
asm("":::"sl");
asm("" : : : "sl");
#endif
for(index = 0; index < 9; index++)
{
@ -4095,7 +4095,7 @@ void JirachiWish(void)
sub_8046860(jirachiEntity,&pos2,itemStack,9);
}
}
jirachiEntity->axObj.info->unk15D = 0;
GetEntInfo(jirachiEntity)->unk15D = 0;
}
if (wishChoice == 3)
@ -4115,7 +4115,7 @@ void JirachiWish(void)
DisplayDungeonDialogue(&gUnknown_8105AD4);
sub_803E708(10,0x46);
JirachiWishGrantDialogue(jirachiEntity);
jirachiEntity->axObj.info->unk15D = 0;
GetEntInfo(jirachiEntity)->unk15D = 0;
DisplayDungeonDialogue(&gUnknown_8105B20);
UnlockFriendArea(friendArea);
PlaySoundEffect(0xd4);
@ -4149,7 +4149,7 @@ void JirachiWish(void)
sub_8046860(jirachiEntity,&pos3,strengthItems,4);
}
}
jirachiEntity->axObj.info->unk15D = 0;
GetEntInfo(jirachiEntity)->unk15D = 0;
DisplayDungeonDialogue(&gUnknown_8105BF4);
sub_803E708(10,0x46);
}
@ -4158,7 +4158,7 @@ void JirachiWish(void)
DisplayDungeonDialogue(&gUnknown_8105D2C);
sub_803E708(10,0x46);
JirachiWishGrantDialogue(jirachiEntity);
jirachiEntity->axObj.info->unk15D = 0;
GetEntInfo(jirachiEntity)->unk15D = 0;
DisplayDungeonDialogue(&gUnknown_8105D80);
sub_803E708(10,0x46);
LeaderPos = &GetLeader()->pos;
@ -4243,7 +4243,7 @@ void sub_808BB3C(Position *pos1)
void sub_808BBA8(Entity *jirachiEntity)
{
sub_806BFC0(jirachiEntity->axObj.info,0);
sub_806BFC0(GetEntInfo(jirachiEntity),0);
}
void JirachiDropInEffect(Entity *jirachiEntity)
@ -4263,10 +4263,10 @@ void JirachiDropInEffect(Entity *jirachiEntity)
iVar2 = 0x100;
}
if (iVar1 < 0) break;
jirachiEntity->axObj.info->unk174 = iVar1;
GetEntInfo(jirachiEntity)->unk174 = iVar1;
sub_803E46C(0x46);
}
jirachiEntity->axObj.info->unk174 = 0;
GetEntInfo(jirachiEntity)->unk174 = 0;
}
void JirachiSpinEffect(Entity * jirachiEntity)
@ -4278,7 +4278,7 @@ void JirachiSpinEffect(Entity * jirachiEntity)
SetFacingDirection(jirachiEntity, uVar1 & DIRECTION_MASK);
sub_803E708(3,0x46);
}
jirachiEntity->axObj.info->unk15E = 1;
GetEntInfo(jirachiEntity)->unk15E = 1;
PlaySoundEffect(0x27f);
sub_80861F8(99,jirachiEntity,1);
}
@ -4287,7 +4287,7 @@ void JirachiWishGrantDialogue(Entity *jirachiEntity)
{
u32 uVar2;
jirachiEntity->axObj.info->unk15D = 1;
GetEntInfo(jirachiEntity)->unk15D = 1;
// Nnnnnnnnnn!
DisplayDungeonDialogue(&gUnknown_81058A8);
PlaySoundEffect(0x375);
@ -4885,11 +4885,11 @@ void sub_808C8E0(Entity *entity)
PlaySoundEffect(0x1a5);
sub_806CDD4(entity, 0, DIRECTION_SOUTH);
for(iVar1 = 0; iVar1 < 16; iVar1++){
entity->axObj.info->unk174 = iVar1 * 256;
GetEntInfo(entity)->unk174 = iVar1 * 256;
sub_803E46C(0x46);
}
for(iVar1 = 16; iVar1 < 200; iVar1 += 4){
entity->axObj.info->unk174 = iVar1 * 256;
GetEntInfo(entity)->unk174 = iVar1 * 256;
sub_803E46C(0x46);
}
sub_8086A3C(entity);
@ -4931,7 +4931,7 @@ void sub_808C998(void)
void sub_808C9B0(Entity *param_1)
{
param_1->axObj.info->action.direction = DIRECTION_NORTH;
GetEntInfo(param_1)->action.direction = DIRECTION_NORTH;
sub_806CE68(param_1, DIRECTION_NORTH);
}

View File

@ -110,7 +110,7 @@ static bool8 xxx_dungeon_80442D0(bool8 param_1)
}
else
{
if (entity->axObj.info->attacking) {
if (GetEntInfo(entity)->attacking) {
return FALSE;
}
else
@ -127,7 +127,7 @@ static bool8 xxx_dungeon_80442D0(bool8 param_1)
(gDungeon->unk673 != 0)))) {
sub_803E46C(0xc);
}
entity->axObj.info->speedStageChanged = FALSE;
GetEntInfo(entity)->speedStageChanged = FALSE;
if (sub_8044B28()) return FALSE;
gDungeon->unkB8 = entity;
gDungeon->unkBC = 0;
@ -147,9 +147,9 @@ static bool8 xxx_dungeon_80442D0(bool8 param_1)
sub_8086AC0();
sub_8043ED0(0);
if (sub_8044B28()) break;
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
if ((entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY)) {
entity->axObj.info->flags = (entityInfo->flags & ~(MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY)) | MOVEMENT_FLAG_UNK_14;
GetEntInfo(entity)->flags = (entityInfo->flags & ~(MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY)) | MOVEMENT_FLAG_UNK_14;
}
if (sub_8044B28() ) break;
sub_8044454();
@ -160,7 +160,7 @@ static bool8 xxx_dungeon_80442D0(bool8 param_1)
param_1 = TRUE;
}
else {
if (!entity->axObj.info->speedStageChanged) break;
if (!GetEntInfo(entity)->speedStageChanged) break;
gDungeon->fractionalTurn = 0;
}
}
@ -183,7 +183,7 @@ static void sub_8044454(void)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
entity = gDungeon->allPokemon[index];
if ((EntityExists(entity)) && (entityInfo = entity->axObj.info, (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) {
if ((EntityExists(entity)) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) {
if (sub_8044B28()) break;
TickStatusHeal(entity);
if (EntityExists(entity)) {
@ -211,7 +211,7 @@ void sub_80444F4(Entity *pokemon)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
entity = gDungeon->allPokemon[index];
if ((EntityExists(entity)) && (pokemon != entity) && (entityInfo = entity->axObj.info, (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) {
if ((EntityExists(entity)) && (pokemon != entity) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) {
if (sub_8044B28()) break;
RunMonsterAI(entity, 0);
sub_8072CF4(entity);

View File

@ -33,7 +33,7 @@ static u8 sub_8046D70(void);
bool8 HasHeldItem(Entity *pokemon, u8 id)
{
// Weird assignment to fix a regswap.
EntityInfo *pokemonInfo = pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = pokemonInfo = GetEntInfo(pokemon);
if (!(pokemonInfo->heldItem.flags & ITEM_FLAG_EXISTS))
{
return FALSE;
@ -177,7 +177,7 @@ bool8 sub_8046F00(Item *item)
{
entity = gDungeon->teamPokemon[index];
if (EntityExists(entity)) {
canLearnMove = CanMonLearnMove(moveID, entity->axObj.info->id);
canLearnMove = CanMonLearnMove(moveID, GetEntInfo(entity)->id);
cannotMove = CheckVariousStatuses2(entity, FALSE);
if (cannotMove) {
canLearnMove = FALSE;
@ -214,7 +214,7 @@ void sub_8046F84(s32 itemFlag)
{
entity = gDungeon->teamPokemon[index];
if (EntityExists(entity)) {
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
item = &entityInfo->heldItem;
if ((item->flags & ITEM_FLAG_EXISTS) && (item->flags & itemFlag)) {
item->id = 0;
@ -245,7 +245,7 @@ void sub_804700C(void)
{
entity = gDungeon->teamPokemon[index];
if (EntityExists(entity)) {
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
item = &entityInfo->heldItem;
if ((item->flags & ITEM_FLAG_EXISTS)) {
xxx_init_itemslot_8090A8C(item, ITEM_PLAIN_SEED, 0);

View File

@ -14,7 +14,7 @@ Entity* GetLeader(void)
for (i = 0; i < MAX_TEAM_MEMBERS; i++)
{
Entity *currentPokemon = gDungeon->teamPokemon[i];
if (EntityExists(currentPokemon) && currentPokemon->axObj.info->isTeamLeader)
if (EntityExists(currentPokemon) && GetEntInfo(currentPokemon)->isTeamLeader)
{
gLeaderPointer = currentPokemon;
return currentPokemon;
@ -27,5 +27,5 @@ Entity* GetLeader(void)
EntityInfo* GetLeaderInfo(void)
{
return GetLeader()->axObj.info;
return GetEntInfo(GetLeader());
}

View File

@ -487,7 +487,7 @@ void sub_8049ED4(void)
Entity *tileObject = tile->object;
if (tileObject != NULL) {
if (GetEntityType(tileObject) == ENTITY_TRAP && (tileObject->isVisible || unk1820F)) {
u8 trapType = tileObject->axObj.info->flags;
u8 trapType = GetEntInfo(tileObject)->flags;
src = &dungeon->unk12A18[trapType][r7];
}
else {
@ -532,7 +532,7 @@ void sub_8049ED4(void)
Entity *tileObject = tile->object;
if (tileObject != NULL) {
if (GetEntityType(tileObject) == ENTITY_TRAP && (tileObject->isVisible || unk1820F)) {
u8 trapType = tileObject->axObj.info->flags;
u8 trapType = GetEntInfo(tileObject)->flags;
src = &dungeon->unk12A18[trapType][r7];
}
else {
@ -602,7 +602,7 @@ void sub_804A1F0(s32 a0, s32 a1)
Entity *tileObject = tile->object;
if (tileObject != NULL) {
if (GetEntityType(tileObject) == ENTITY_TRAP && (tileObject->isVisible || unk1820F)) {
u8 trapType = tileObject->axObj.info->flags;
u8 trapType = GetEntInfo(tileObject)->flags;
src = &dungeon->unk12A18[trapType][r6];
}
else {
@ -643,7 +643,7 @@ void sub_804A1F0(s32 a0, s32 a1)
Entity *tileObject = tile->object;
if (tileObject != NULL) {
if (GetEntityType(tileObject) == ENTITY_TRAP && (tileObject->isVisible || unk1820F)) {
u8 trapType = tileObject->axObj.info->flags;
u8 trapType = GetEntInfo(tileObject)->flags;
src = &dungeon->unk12A18[trapType][r6];
}
else {
@ -703,7 +703,7 @@ void sub_804A49C(s32 a0, s32 a1)
Entity *tileObject = tile->object;
if (tileObject != NULL) {
if (GetEntityType(tileObject) == ENTITY_TRAP && (tileObject->isVisible || unk1820F)) {
u8 trapType = tileObject->axObj.info->flags;
u8 trapType = GetEntInfo(tileObject)->flags;
src = &dungeon->unk12A18[trapType][r6];
}
else {
@ -744,7 +744,7 @@ void sub_804A49C(s32 a0, s32 a1)
Entity *tileObject = tile->object;
if (tileObject != NULL) {
if (GetEntityType(tileObject) == ENTITY_TRAP && (tileObject->isVisible || unk1820F)) {
u8 trapType = tileObject->axObj.info->flags;
u8 trapType = GetEntInfo(tileObject)->flags;
src = &dungeon->unk12A18[trapType][r6];
}
else {

View File

@ -508,7 +508,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move
gUnknown_202F208++;
gUnknown_202F20C++;
targetInfo = currTarget->axObj.info; // currTarget could've been changed, hence info pointers needs to be reloaded
targetInfo = GetEntInfo(currTarget); // currTarget could've been changed, hence info pointers needs to be reloaded
targetInfo->unk15A = 0;
if (targetInfo->isNotTeamMember) {
targetInfo->targetPos = attacker->pos;
@ -527,7 +527,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move
sub_8041B48(currTarget);
sub_80559DC(currTarget, attacker);
currTarget = attacker;
targetInfo = attacker->axObj.info;
targetInfo = GetEntInfo(attacker);
targetInfo->unk15A = 0;
moveRedirected = TRUE;
}
@ -544,7 +544,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move
sub_8041BA8(currTarget);
sub_80559DC(currTarget, attacker);
currTarget = attacker;
targetInfo = attacker->axObj.info;
targetInfo = GetEntInfo(attacker);
targetInfo->unk15A = 0;
moveRedirected = TRUE;
}
@ -3022,7 +3022,7 @@ bool8 MoveMatchesChargingStatus(Entity *pokemon, Move *move)
}
else
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
s32 i;
for (i = 0; i < 100; i++)
{
@ -3048,7 +3048,7 @@ bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge)
}
else
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
int i = 0;
u8 *chargingStatusPointer = &pokemonInfo->charging.chargingStatus;
u8 *chargingStatusPointer2;
@ -3087,7 +3087,7 @@ u32 sub_8057144(Entity * pokemon)
{
Entity *dungeonMon = gDungeon->allPokemon[i];
if (EntityExists(dungeonMon)) {
Move *moves = dungeonMon->axObj.info->moves.moves;
Move *moves = GetEntInfo(dungeonMon)->moves.moves;
for (j = 0; j < MAX_MON_MOVES; j++)
{
if (moves[j].moveFlags & MOVE_FLAG_EXISTS
@ -3114,7 +3114,7 @@ bool8 sub_80571F0(Entity * pokemon, Move *move)
s32 tileset;
EntityInfo *entityInfo;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
if (entityInfo->unkFF == 1) {
moveID = move->id;
@ -3153,7 +3153,7 @@ bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance)
return FALSE;
if (!EntityExists(pokemon) || !EntityExists(target))
return FALSE;
if (target->axObj.info->unk158 == 0 || target->axObj.info->HP == 0)
if (GetEntInfo(target)->unk158 == 0 || GetEntInfo(target)->HP == 0)
return FALSE;
if (chance != 0) {
@ -3216,7 +3216,7 @@ bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker)
bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
if (move->id == MOVE_REGULAR_ATTACK)
{
return TRUE;
@ -3257,7 +3257,7 @@ bool8 sub_805744C(Entity * pokemon, Move *move, bool8 param_3)
{
EntityInfo *entityInfo;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
if (move->id != MOVE_REGULAR_ATTACK) {
if (((move->moveFlags & MOVE_FLAG_DISABLED)) || ((move->moveFlags2 & MOVE_FLAG_EXISTS))) {
return FALSE;

View File

@ -73,7 +73,7 @@ u8 sub_80703A0(Entity *pokemon, Position *pos)
u16 tileFlags;
EntityInfo *entityInfo;
entityInfo = pokemon->axObj.info;
entityInfo = pokemon->axObj.info; // GetEntInfo doesn't work here, replacing uses of entityInfo with a call *almost* works
tile = GetTile(pos->x,pos->y);
if ((pos->x >= 0) && (pos->y >= 0) && (DUNGEON_MAX_SIZE_X > pos->x) &&
(DUNGEON_MAX_SIZE_Y > pos->y) && (tile->monster == NULL) && ((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) {
@ -129,7 +129,7 @@ bool8 sub_807049C(Entity *pokemon, Position *pos)
u16 tileFlags;
EntityInfo *entityInfo;
entityInfo = pokemon->axObj.info;
entityInfo = pokemon->axObj.info; // GetEntInfo doesn't work here
tile = GetTile(pos->x, pos->y);
if ((pos->x >= 0) && (pos->y >= 0) && (DUNGEON_MAX_SIZE_X > pos->x) &&
(DUNGEON_MAX_SIZE_Y > pos->y && ((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) &&
@ -176,7 +176,7 @@ bool8 sub_8070564(Entity *pokemon, Position *pos)
s32 crossableTerrain2;
#endif
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
tile = GetTile(pos->x, pos->y);
if ((pos->x >= 0) && (pos->y >= 0) && (DUNGEON_MAX_SIZE_X > pos->x) &&
(DUNGEON_MAX_SIZE_Y > pos->y && ((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) &&
@ -213,7 +213,7 @@ bool8 sub_80705F0(Entity *pokemon, Position *pos)
u16 tileFlags;
EntityInfo *entityInfo;
entityInfo = pokemon->axObj.info;
entityInfo = pokemon->axObj.info; // GetEntInfo doesn't work here
tile = GetTile(pos->x, pos->y);
if ((pos->x >= 0) && (pos->y >= 0) && (DUNGEON_MAX_SIZE_X > pos->x) &&
(DUNGEON_MAX_SIZE_Y > pos->y && ((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) &&
@ -251,11 +251,11 @@ bool8 sub_80706A4(Entity *pokemon, Position *pos)
u16 tileFlags;
EntityInfo *entityInfo;
entityInfo = pokemon->axObj.info;
entityInfo = pokemon->axObj.info; // GetEntInfo doesn't work here
tile = GetTile(pos->x, pos->y);
if ((pos->x >= 0) && (pos->y >= 0) && (DUNGEON_MAX_SIZE_X > pos->x) &&
(DUNGEON_MAX_SIZE_Y > pos->y && ((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) &&
((tile->monster == NULL) || ((GetEntityType(tile->monster) == ENTITY_MONSTER) && (tile->monster->axObj.info == entityInfo)))) {
((tile->monster == NULL) || ((GetEntityType(tile->monster) == ENTITY_MONSTER) && (GetEntInfo(tile->monster) == entityInfo)))) {
if (IsCurrentFixedRoomBossFight() || (entityInfo->transformStatus.transformStatus != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) {
crossableTerrain = GetCrossableTerrain(entityInfo->id);
tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY);
@ -290,7 +290,7 @@ s32 CalcSpeedStage(Entity *pokemon)
s32 speed;
EntityInfo * entityInfo;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
speed = 0;
for(index = 0; index < NUM_SPEED_COUNTERS; index++)

View File

@ -41,9 +41,9 @@ void sub_8083AB0(s16 param_0, Entity * target, Entity * entity)
temp = &gDungeon->unk1CE98;
targetEntityInfo = NULL;
if ((EntityExists(target)) && (GetEntityType(target) == ENTITY_MONSTER)) {
targetEntityInfo = target->axObj.info;
targetEntityInfo = GetEntInfo(target);
}
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
if (targetEntityInfo != NULL) {
sub_80709C8(buffer, targetEntityInfo);
CopyStringtoBuffer(temp->buffer1, buffer);

View File

@ -27,7 +27,7 @@ extern bool8 sub_805744C(Entity *, Move *, u32);
bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage)
{
if (target->axObj.info->protection.protectionStatus == STATUS_SAFEGUARD) {
if (GetEntInfo(target)->protection.protectionStatus == STATUS_SAFEGUARD) {
if (displayMessage) {
SetMessageArgument(gAvailablePokemonNames,target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2FC);
@ -39,7 +39,7 @@ bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage
bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage)
{
if (target->axObj.info->protection.protectionStatus == STATUS_MIST) {
if (GetEntInfo(target)->protection.protectionStatus == STATUS_MIST) {
if (displayMessage) {
SetMessageArgument(gAvailablePokemonNames, target, 0);
TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FC31C);
@ -63,7 +63,7 @@ bool8 sub_80717A4(Entity *pokemon, u16 moveID)
EntityInfo * entityInfo;
s32 index;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
if ((entityInfo->sleep.sleep != STATUS_SLEEP) && (entityInfo->sleep.sleep != STATUS_NAPPING) && (entityInfo->sleep.sleep != STATUS_NIGHTMARE)) {
return FALSE;
}
@ -97,7 +97,7 @@ bool8 HasAbility(Entity *pokemon, u8 ability)
}
else
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
if (pokemonInfo->abilities[0] == ability || pokemonInfo->abilities[1] == ability)
{
return TRUE;
@ -108,7 +108,7 @@ bool8 HasAbility(Entity *pokemon, u8 ability)
bool8 MonsterIsType(Entity *pokemon, u8 type)
{
EntityInfo *pokemonInfo = pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = pokemonInfo = GetEntInfo(pokemon);
if (type == TYPE_NONE)
{
return FALSE;
@ -126,7 +126,7 @@ bool8 MonsterIsType(Entity *pokemon, u8 type)
bool8 CanSeeInvisibleMonsters(Entity *pokemon)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
if (pokemonInfo->eyesightStatus.eyesightStatus != STATUS_EYEDROPS)
{
if (!HasHeldItem(pokemon, ITEM_GOGGLE_SPECS))
@ -140,7 +140,7 @@ bool8 CanSeeInvisibleMonsters(Entity *pokemon)
bool8 HasTactic(Entity *pokemon, u8 tactic)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
if (pokemonInfo->isTeamLeader)
{
bool8 isGoTheOtherWay = tactic == TACTIC_GO_THE_OTHER_WAY;
@ -151,12 +151,12 @@ bool8 HasTactic(Entity *pokemon, u8 tactic)
bool8 IQSkillIsEnabled(Entity *pokemon, u8 IQSkill)
{
return IsIQSkillSet(pokemon->axObj.info->IQSkillFlags, 1 << IQSkill);
return IsIQSkillSet(GetEntInfo(pokemon)->IQSkillFlags, 1 << IQSkill);
}
bool8 IQSkillPairIsEnabled(Entity *pokemon, u8 IQSkill1, u8 IQSkill2)
{
return IsIQSkillSet(pokemon->axObj.info->IQSkillFlags,
return IsIQSkillSet(GetEntInfo(pokemon)->IQSkillFlags,
1 << IQSkill1 | 1 << IQSkill2);
}
@ -166,7 +166,7 @@ void LoadIQSkills(Entity *pokemon)
s32 IQSkill;
EntityInfo *pokemonInfo;
pokemonInfo = pokemon->axObj.info;
pokemonInfo = GetEntInfo(pokemon);
if (pokemonInfo->isNotTeamMember) {
iVar2 = pokemonInfo->IQSkillFlags;
SetIQSkill(iVar2, IQ_STATUS_CHECKER);
@ -198,7 +198,7 @@ bool8 CanSeeTeammate(Entity * pokemon)
Entity *teamMember;
s32 memberIdx;
if (pokemon->axObj.info->isNotTeamMember) {
if (GetEntInfo(pokemon)->isNotTeamMember) {
return FALSE;
}
else
@ -218,7 +218,7 @@ bool8 CanSeeTeammate(Entity * pokemon)
u8 GetMoveTypeForMonster(Entity *pokemon, Move *pokeMove)
{
if (pokeMove->id == MOVE_HIDDEN_POWER)
return pokemon->axObj.info->hiddenPower.hiddenPowerType;
return GetEntInfo(pokemon)->hiddenPower.hiddenPowerType;
else
return GetMoveType(pokeMove);
}
@ -226,7 +226,7 @@ u8 GetMoveTypeForMonster(Entity *pokemon, Move *pokeMove)
s32 GetMovePower(Entity *pokemon, Move *pokeMove)
{
if(pokeMove->id == MOVE_HIDDEN_POWER)
return (pokemon->axObj.info->hiddenPower.hiddenPowerBasePower + pokeMove->ginseng);
return (GetEntInfo(pokemon)->hiddenPower.hiddenPowerBasePower + pokeMove->ginseng);
else
return (GetMoveBasePower(pokeMove) + pokeMove->ginseng);
}
@ -252,7 +252,7 @@ bool8 sub_8071A8C(Entity *pokemon)
EntityInfo *pokemonInfo;
if(EntityExists(pokemon))
{
pokemonInfo = pokemon->axObj.info;
pokemonInfo = GetEntInfo(pokemon);
if(pokemonInfo->clientType != CLIENT_TYPE_CLIENT)
{
if(!sub_8071A8C_sub(pokemonInfo))

View File

@ -47,22 +47,22 @@ u8 GetEntityRoom(Entity *entity)
Trap* GetTrapData(Entity *entity)
{
return (Trap *) entity->axObj.info;
return (Trap *) GetEntInfo(entity);
}
Item* GetItemData(Entity *entity)
{
return (Item *) entity->axObj.info;
return (Item *) GetEntInfo(entity);
}
Trap* GetTrapData_1(Entity *entity)
{
return (Trap *) entity->axObj.info;
return (Trap *) GetEntInfo(entity);
}
Item* GetItemData_1(Entity *entity)
{
return (Item*) entity->axObj.info;
return (Item*) GetEntInfo(entity);
}
Tile *GetTileAtEntity(Entity *entity)
@ -141,7 +141,7 @@ void sub_804522C(void) {
}
else
{
info = entity->axObj.info;
info = GetEntInfo(entity);
statusSprites = EntityGetStatusSprites(entity);
UpdateDungeonPokemonSprite(info->unk98, info->apparentID, statusSprites, FALSE);
}

View File

@ -37,7 +37,7 @@ Entity *GetPartnerEntity(void)
for(counter = 0; counter < MAX_TEAM_MEMBERS; counter++)
{
entity = gDungeon->teamPokemon[counter];
if(EntityExists(entity) && entity->axObj.info->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER)
if(EntityExists(entity) && GetEntInfo(entity)->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER)
{
return entity;
}
@ -74,7 +74,7 @@ void sub_80854D4(void)
for(index = 0; index < MAX_TEAM_MEMBERS; index++)
{
entity2 = stack1[index];
if(entity2 != NULL && entity2->axObj.info->isTeamLeader)
if(entity2 != NULL && GetEntInfo(entity2)->isTeamLeader)
{
stack1[index] = NULL;
stack2[counter] = entity2;
@ -84,7 +84,7 @@ void sub_80854D4(void)
for(index = 0; index < MAX_TEAM_MEMBERS; index++)
{
entity3 = stack1[index];
if(entity3 != NULL && entity3->axObj.info->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER)
if(entity3 != NULL && GetEntInfo(entity3)->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER)
{
stack1[index] = NULL;
stack2[counter] = entity3;
@ -125,7 +125,7 @@ void sub_80855E4(DungeonCallback func)
{
entity = gDungeon->teamPokemon[index];
if (EntityExists(entity)) {
if (entity->axObj.info->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER) {
if (GetEntInfo(entity)->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER) {
flag = TRUE;
}
func(entity);
@ -144,7 +144,7 @@ void sub_808563C(DungeonCallback func)
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
{
entity = gDungeon->wildPokemon[index];
if ((EntityExists(entity)) && (entity->axObj.info->joinedAt.joinedAt != 0x41)) {
if ((EntityExists(entity)) && (GetEntInfo(entity)->joinedAt.joinedAt != 0x41)) {
func(entity);
}
}
@ -158,7 +158,7 @@ Entity *GetEntityFromClientType(u8 entityType)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
entity = gDungeon->allPokemon[index];
if ((EntityExists(entity)) && (entity->axObj.info->clientType == entityType)) return entity;
if ((EntityExists(entity)) && (GetEntInfo(entity)->clientType == entityType)) return entity;
}
return NULL;
}
@ -174,7 +174,7 @@ void sub_80856E0(Entity * pokemon, s32 direction)
EntityInfo *entityInfo;
s32 counter;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
sub_80861D4(pokemon, 6, direction);
for(counter = 0; counter < 5; counter++)
@ -204,7 +204,7 @@ void sub_8085764(void)
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
{
entity = gDungeon->wildPokemon[index];
if ((EntityExists(entity)) && (entity->axObj.info->clientType == CLIENT_TYPE_PARTNER)) {
if ((EntityExists(entity)) && (GetEntInfo(entity)->clientType == CLIENT_TYPE_PARTNER)) {
sub_8068FE0(entity,0x207,&stackEntity);
}
}
@ -221,7 +221,7 @@ void sub_80857B8(void)
{
entity = gDungeon->allPokemon[index];
if (EntityExists(entity)) {
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
if ((gDungeon->unk4 == 0) && (gDungeon->unk2 == 0)) {
sub_804535C(entity, 0);
entityInfo->unk15C = 0;
@ -274,7 +274,7 @@ void ShiftCameraToPosition(Position32 *posStruct, s32 cameraSteps)
void SetFacingDirection(Entity *pokemon, s32 direction)
{
pokemon->axObj.info->action.direction = direction & DIRECTION_MASK;
GetEntInfo(pokemon)->action.direction = direction & DIRECTION_MASK;
sub_806CE68(pokemon, direction);
}
@ -293,7 +293,7 @@ void sub_8085930(s32 direction)
}
else
{
entity->axObj.info->action.direction = direction & DIRECTION_MASK;
GetEntInfo(entity)->action.direction = direction & DIRECTION_MASK;
sub_806CE68(entity, direction);
}
}
@ -303,7 +303,7 @@ void sub_8085930(s32 direction)
entity = gDungeon->wildPokemon[index];
if(EntityExists(entity))
{
if(entity->axObj.info->clientType == CLIENT_TYPE_PARTNER)
if(GetEntInfo(entity)->clientType == CLIENT_TYPE_PARTNER)
{
if(direction >= NUM_DIRECTIONS)
{
@ -311,7 +311,7 @@ void sub_8085930(s32 direction)
}
else
{
entity->axObj.info->action.direction = direction & DIRECTION_MASK;
GetEntInfo(entity)->action.direction = direction & DIRECTION_MASK;
sub_806CE68(entity, direction);
}
}
@ -334,7 +334,7 @@ void sub_80859F0(s32 direction)
}
else
{
entity->axObj.info->action.direction = direction & DIRECTION_MASK;
GetEntInfo(entity)->action.direction = direction & DIRECTION_MASK;
sub_806CE68(entity, direction);
}
}
@ -343,7 +343,7 @@ void sub_80859F0(s32 direction)
bool8 IsMovingClient(Entity *pokemon)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
switch (pokemonInfo->clientType)
{
case CLIENT_TYPE_CLIENT:

View File

@ -16,16 +16,16 @@ bool8 CanSeeTarget(Entity *entity, Entity *targetEntity)
{
if (entity->type == ENTITY_MONSTER)
{
if (!CanSeeInvisibleMonsters(entity) && targetEntity->axObj.info->transformStatus.transformStatus == STATUS_INVISIBLE)
if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->transformStatus.transformStatus == STATUS_INVISIBLE)
{
return FALSE;
}
if (entity->axObj.info->eyesightStatus.eyesightStatus == STATUS_BLINKER)
if (GetEntInfo(entity)->eyesightStatus.eyesightStatus == STATUS_BLINKER)
{
return FALSE;
}
}
else if (targetEntity->axObj.info->transformStatus.transformStatus == STATUS_INVISIBLE)
else if (GetEntInfo(targetEntity)->transformStatus.transformStatus == STATUS_INVISIBLE)
{
return FALSE;
}
@ -43,16 +43,16 @@ bool8 CanTargetEntity(Entity *entity, Entity *targetEntity)
{
if (entity->type == ENTITY_MONSTER)
{
if (!CanSeeInvisibleMonsters(entity) && targetEntity->axObj.info->transformStatus.transformStatus == STATUS_INVISIBLE)
if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->transformStatus.transformStatus == STATUS_INVISIBLE)
{
return FALSE;
}
if (entity->axObj.info->eyesightStatus.eyesightStatus == STATUS_BLINKER)
if (GetEntInfo(entity)->eyesightStatus.eyesightStatus == STATUS_BLINKER)
{
return FALSE;
}
}
else if (targetEntity->axObj.info->transformStatus.transformStatus == STATUS_INVISIBLE)
else if (GetEntInfo(targetEntity)->transformStatus.transformStatus == STATUS_INVISIBLE)
{
return FALSE;
}

View File

@ -238,7 +238,7 @@ void sub_8057588(Entity * pokemon, u8 param_2)
EntityInfo *entityInfo;
if (EntityExists(pokemon)) {
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
for(index = 0; index < MAX_MON_MOVES; index++)
{
move = &entityInfo->moves.moves[index];
@ -429,7 +429,7 @@ bool32 sub_8057974(Entity *pokemon, Entity *target, Move *move, u32 param_4)
s32 newHP;
bool8 local_24;
newHP = target->axObj.info->HP / 2;
newHP = GetEntInfo(target)->HP / 2;
local_24 = FALSE;
if (newHP != 0) {
sub_806F370(pokemon,target,newHP,1,&local_24,GetMoveType(move),sub_8057600(move,param_4),0,1,0);
@ -474,7 +474,7 @@ bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4
EntityInfo *entityInfo;
bool8 isTormented;
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
isTormented = FALSE;
for(iVar4 = 0; iVar4 < MAX_MON_MOVES; iVar4++)
@ -596,7 +596,7 @@ bool8 WhirlpoolMoveAction(Entity * pokemon, Entity * target, Move * move, u32 pa
u8 chargeStatus;
flag = FALSE;
chargeStatus = target->axObj.info->charging.chargingStatus;
chargeStatus = GetEntInfo(target)->charging.chargingStatus;
uVar3 = 0x100;
if (chargeStatus == STATUS_DIVING) {
uVar3 = 0x200;
@ -666,7 +666,7 @@ bool8 sub_8057E6C(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 flag;
flag = FALSE;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
SendThawedMessage(pokemon,target);
if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -696,7 +696,7 @@ bool8 sub_8057F24(Entity *pokemon, Entity *target, Move *move, s32 param_4)
{
EntityInfo *entityInfo;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
entityInfo->HP = 1;
ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A4C,0x40,TRUE);
ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A50,0x40,TRUE);
@ -732,8 +732,8 @@ bool8 sub_8057FF4(Entity *pokemon, Entity *target, Move *move, s32 param_4)
flashFireStatus = GetFlashFireStatus(target);
if (flashFireStatus != FLASH_FIRE_STATUS_NONE) {
if (target->axObj.info->unk152 == 0) {
target->axObj.info->unk152 = 1;
if (GetEntInfo(target)->unk152 == 0) {
GetEntInfo(target)->unk152 = 1;
SetMessageArgument(gUnknown_202DFE8,target,0);
if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE00); // Fire moves won't become stronger
@ -758,7 +758,7 @@ bool8 sub_805805C(Entity * pokemon,Entity * target,Move * move,s32 param_4)
EntityInfo *entityInfo;
s32 IQ;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
r6 = 1;
@ -785,7 +785,7 @@ bool8 GrudgeMoveAction(Entity *pokemon, Entity * target, Move *move, s32 param_4
bool8 hasGrudge;
hasGrudge = FALSE;
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gUnknown_202DFE8,target,0);
if (entityInfo->grudge) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD2B4);
@ -856,7 +856,7 @@ bool8 sub_8058270(Entity *pokemon, Entity *target, Move *move, u32 param_4)
u32 r3;
r3 = 1;
if((u8)(target->axObj.info->charging.chargingStatus - 7) <= 1)
if((u8)(GetEntInfo(target)->charging.chargingStatus - 7) <= 1)
r3 = 2;
flag = HandleDamagingMove(pokemon,target,move,r3 << 8,param_4) ? TRUE : FALSE;
return flag;
@ -907,7 +907,7 @@ bool8 sub_805836C(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 local_18;
local_18 = FALSE;
iVar2 = pokemon->axObj.info->unkA0 * 2;
iVar2 = GetEntInfo(pokemon)->unkA0 * 2;
if (999 < iVar2) {
iVar2 = 999;
}
@ -971,8 +971,8 @@ bool8 sub_80584C0(Entity *pokemon, Entity *target, Move *move, u32 param_4)
local_24 = 0;
entityInfo = pokemon->axObj.info;
entityInfo1 = target->axObj.info;
entityInfo = GetEntInfo(pokemon);
entityInfo1 = GetEntInfo(target);
diffHP = entityInfo1->HP - entityInfo->HP;
if (diffHP < 0) {
diffHP = 0;
@ -989,7 +989,7 @@ bool8 sub_8058548(Entity *pokemon, Entity *target, Move *move, u32 param_4)
u32 r5;
r5 = 0x80 << 1;
if((pokemon->axObj.info->nonVolatile.nonVolatileStatus) != STATUS_NONE)
if((GetEntInfo(pokemon)->nonVolatile.nonVolatileStatus) != STATUS_NONE)
r5 = gUnknown_80F4F6C;
flag = HandleDamagingMove(pokemon,target,move,r5,param_4) ? TRUE : FALSE;
return flag;
@ -1015,7 +1015,7 @@ bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, u32 para
bool8 flag;
flag = FALSE;
if ((target->axObj.info->protection.protectionStatus == STATUS_REFLECT) || (target->axObj.info->protection.protectionStatus == STATUS_LIGHT_SCREEN)) {
if ((GetEntInfo(target)->protection.protectionStatus == STATUS_REFLECT) || (GetEntInfo(target)->protection.protectionStatus == STATUS_LIGHT_SCREEN)) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD104); // The barrier was shattered
SendProtectionEndMessage(pokemon,target);
flag = TRUE;
@ -1068,7 +1068,7 @@ bool8 sub_80586DC(Entity * pokemon, Entity * target, Move * move, u32 param_4)
flag = uVar3 != 0 ? TRUE : FALSE;
if (flag && sub_8057308(pokemon, 0)) {
newHP = uVar3 / 2;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
flag = TRUE;
if (newHP < 1) {
newHP = 1;
@ -1113,7 +1113,7 @@ bool8 sub_80587E8(Entity * pokemon, Entity * target, Move * move, u32 param_4)
{
bool8 flag;
if (target->axObj.info->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) {
if (GetEntInfo(target)->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) {
flag = HandleDamagingMove(pokemon,target,move,0x80 << 2,param_4) ? TRUE : FALSE;
SendNonVolatileEndMessage(pokemon, target);
}
@ -1166,7 +1166,7 @@ bool8 sub_80588B8(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_80588F4(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
EntityInfo *entityInfo = target->axObj.info;
EntityInfo *entityInfo = GetEntInfo(target);
flag = HandleDamagingMove(pokemon, target, move, GetWeight(entityInfo->apparentID), param_4) != 0 ? TRUE: FALSE;
return flag;
@ -1184,7 +1184,7 @@ bool8 sub_8058930(Entity *pokemon, Entity *target, Move *move, u32 param_4)
flag = TRUE;
if(sub_8057308(pokemon, gUnknown_80F4DD6))
{
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
RaiseMovementSpeedTarget(pokemon, pokemon, 0, TRUE);
index1 = gUnknown_8106A4C;
RaiseAttackStageTarget(pokemon, pokemon, index1, 1);
@ -1282,7 +1282,7 @@ bool8 sub_8058B84(Entity *pokemon, Entity *target, Move *move, u32 param_4)
flag = TRUE;
if(sub_805727C(pokemon, pokemon, gUnknown_80F4DD0))
{
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
RaiseAttackStageTarget(pokemon, pokemon, gUnknown_8106A4C, 1);
SetExpMultplier(entityInfo);
}
@ -1323,7 +1323,7 @@ bool8 sub_8058C48(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 flag;
rand = DungeonRandRange(128, 384); // 0x80 - 0x180
rand = (rand * pokemon->axObj.info->level) / 256;
rand = (rand * GetEntInfo(pokemon)->level) / 256;
if (rand < 0) {
rand = 1;
}
@ -1401,8 +1401,8 @@ bool8 PsychUpMoveAction(Entity * pokemon, Entity * target, Move * move, u32 para
EntityInfo *iVar3;
EntityInfo *iVar4;
iVar4 = pokemon->axObj.info;
iVar3 = target->axObj.info;
iVar4 = GetEntInfo(pokemon);
iVar3 = GetEntInfo(target);
nullsub_92(target);
for(index = 0; index < 2; index++)
@ -1427,7 +1427,7 @@ bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4)
flag = FALSE;
if ((HandleDamagingMove(pokemon, target, move, 0x80 << 1, param_4) != 0) && (EntityExists(pokemon))) {
iVar2 = pokemon->axObj.info->maxHPStat;
iVar2 = GetEntInfo(pokemon)->maxHPStat;
if (iVar2 < 0) {
iVar2 = iVar2 + 7;
}
@ -1445,7 +1445,7 @@ bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4)
bool8 sub_8058EE0(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
HealTargetHP(pokemon, target, target->axObj.info->maxHPStat / 2, 0, TRUE);
HealTargetHP(pokemon, target, GetEntInfo(target)->maxHPStat / 2, 0, TRUE);
return TRUE;
}
@ -1455,7 +1455,7 @@ bool32 sub_8058F04(Entity *pokemon, Entity *target, Move *move, s32 param_4)
EntityInfo *entityInfo;
s32 iVar3;
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
iVar3 = 1;
gDungeon->unk181e8.unk18200 = 0xc;
gDungeon->unk181e8.unk18204 = 0;
@ -1712,7 +1712,7 @@ bool8 sub_805946C(Entity * pokemon,Entity * target,Move * move,u32 param_4)
if (HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) {
flag = TRUE;
if ((!HasAbility(pokemon, ABILITY_ROCK_HEAD)) && (sub_8057308(pokemon,0) != 0)) {
HP = pokemon->axObj.info->maxHPStat;
HP = GetEntInfo(pokemon)->maxHPStat;
if (HP < 0) {
HP = HP + 7;
}
@ -1898,7 +1898,7 @@ bool8 sub_8059928(Entity * pokemon,Entity * target,Move * move,u32 param_4)
iVar2 = 1;
flag = FALSE;
if ((u8)(target->axObj.info->charging.chargingStatus - 7) <= 1){
if ((u8)(GetEntInfo(target)->charging.chargingStatus - 7) <= 1){
iVar2 = 2;
}
if (HandleDamagingMove(pokemon,target,move,iVar2 << 8,param_4) != 0)
@ -1931,7 +1931,7 @@ bool8 sub_80599EC(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
s32 HP;
HP = target->axObj.info->maxHPStat;
HP = GetEntInfo(target)->maxHPStat;
if(HP < 0)
HP += 3;
HealTargetHP(pokemon, target, HP >> 2, 0, TRUE);
@ -1950,7 +1950,7 @@ bool8 sub_8059A2C(Entity * pokemon,Entity * target,Move * move,u32 param_4)
u32 level;
local_20 = 0;
level = pokemon->axObj.info->level;
level = GetEntInfo(pokemon)->level;
sub_806F370(pokemon,target,level,1,&local_20,GetMoveType(move),sub_8057600(move,param_4),0,1,0);
local_20 = local_20 == 0;
return local_20;
@ -2007,7 +2007,7 @@ bool8 ConversionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 para
Move *moveStack [MAX_MON_MOVES];
counter = 0;
info = target->axObj.info;
info = GetEntInfo(target);
if (HasAbility(target, ABILITY_FORECAST)) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsTypeSwitchMessage);
return FALSE;
@ -2176,7 +2176,7 @@ bool8 sub_8059E54(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 pa
movePower = GetMovePower(pokemon,move);
moveCritChance = GetMoveCritChance(move);
sub_806EAF4(pokemon,target,moveType,movePower,moveCritChance,local_30,0x100,move->id,0);
SetMessageArgument_2(gAvailablePokemonNames,pokemon->axObj.info,0);
SetMessageArgument_2(gAvailablePokemonNames,GetEntInfo(pokemon),0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC7C8);
local_30[0] = local_30[0] / 2;
if (local_30[0] == 0) {
@ -2226,7 +2226,7 @@ bool8 sub_8059FC8(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 pa
movePower = GetMovePower(pokemon,move);
moveCritChance = GetMoveCritChance(move);
sub_806EAF4(pokemon,target,moveType,movePower,moveCritChance,local_30,0x200,move->id,0);
SetMessageArgument_2(gAvailablePokemonNames,pokemon->axObj.info,0);
SetMessageArgument_2(gAvailablePokemonNames,GetEntInfo(pokemon),0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC7C8);
local_30[0] = local_30[0] / 2;
if (local_30[0] == 0) {
@ -2277,9 +2277,9 @@ bool8 sub_805A120(Entity * pokemon,Entity * target, Move *move, u32 param_4)
Item *item2;
flag = FALSE;
r9 = pokemon->axObj.info;
r9 = GetEntInfo(pokemon);
r7 = r9;
r8 = target->axObj.info;
r8 = GetEntInfo(target);
sp = r8;
SetMessageArgument(gAvailablePokemonNames,pokemon,0);
@ -2382,7 +2382,7 @@ bool8 SurfMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
u32 uVar2;
flag = FALSE;
if (target->axObj.info->charging.chargingStatus == STATUS_DIVING) {
if (GetEntInfo(target)->charging.chargingStatus == STATUS_DIVING) {
uVar2 = 0x200;
}
else
@ -2399,8 +2399,8 @@ bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_
EntityInfo * entityInfo;
EntityInfo * targetEntityInfo;
entityInfo = pokemon->axObj.info;
targetEntityInfo = target->axObj.info;
entityInfo = GetEntInfo(pokemon);
targetEntityInfo = GetEntInfo(target);
if (HasAbility(target, ABILITY_WONDER_GUARD)) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC854);
return FALSE;
@ -2502,7 +2502,7 @@ bool8 SwallowMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4
{
u8 *stockpileStage;
stockpileStage = &target->axObj.info->stockpileStage;
stockpileStage = &GetEntInfo(target)->stockpileStage;
if (*stockpileStage != 0) {
HealTargetHP(pokemon,target,gUnknown_80F51D4[*stockpileStage],0,TRUE);
*stockpileStage = 0;
@ -2553,7 +2553,7 @@ bool8 sub_805A5E8(Entity *pokemon, Entity *target, Move *move, u32 stat, u32 par
if (HandleDamagingMove(pokemon,target,move,0x100,param_5) != 0) {
flag = TRUE;
if (sub_805727C(pokemon,pokemon,gUnknown_80F4DD2) != 0) {
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
RaiseDefenseStageTarget(pokemon,pokemon,stat,1);
SetExpMultplier(entityInfo);
}
@ -2565,7 +2565,7 @@ bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
u8 *stockpileStage;
stockpileStage = &pokemon->axObj.info->stockpileStage;
stockpileStage = &GetEntInfo(pokemon)->stockpileStage;
if (*stockpileStage != 0) {
HandleDamagingMove(pokemon,target,move,*stockpileStage << 8,param_4);
*stockpileStage = 0;
@ -2748,7 +2748,7 @@ _0805AA5E:
if (sub_80706A4(target, pos)) {
sub_807D148(pokemon,target,0,0);
}
if (target->axObj.info->isTeamLeader) {
if (GetEntInfo(target)->isTeamLeader) {
sub_804AC20(r9);
sub_807EC28(FALSE);
}
@ -2770,7 +2770,7 @@ bool8 BellyDrumMoveAction(Entity * pokemon,Entity * target, Move *move, u32 para
EntityInfo *info;
bool8 flag;
info = pokemon->axObj.info;
info = GetEntInfo(pokemon);
flag = FALSE;
if (FixedPointToInt(info->belly) > 1) {
RaiseAttackStageTarget(pokemon,target,gUnknown_8106A4C,99);
@ -2955,7 +2955,8 @@ bool8 PresentMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param
}
else {
if (rand1 < 30) {
HealTargetHP(pokemon,target,target->axObj.info->maxHPStat/4,0,TRUE);
HealTargetHP(pokemon,target,GetEntInfo(target)->maxHPStat/4,0,
TRUE);
return TRUE;
}
else if (rand2 >= 60) {

View File

@ -104,7 +104,7 @@ const u8 gDungeonCamouflageTypes[76] = {
bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
switch (move->id)
{
case MOVE_HAIL:
@ -172,7 +172,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move)
#else
r1 = 0;
#endif
if (pokemon->axObj.info->speedStage >= MAX_SPEED_STAGE)
if (GetEntInfo(pokemon)->speedStage >= MAX_SPEED_STAGE)
{
r1 = !r1;
return FALSE;
@ -284,7 +284,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move)
}
break;
case MOVE_DRAGON_DANCE:
if (pokemonInfo->offensiveStages[STAT_STAGE_ATK] >= MAX_STAT_STAGE && pokemon->axObj.info->speedStage >= MAX_SPEED_STAGE)
if (pokemonInfo->offensiveStages[STAT_STAGE_ATK] >= MAX_STAT_STAGE && GetEntInfo(pokemon)->speedStage >= MAX_SPEED_STAGE)
{
return FALSE;
}
@ -497,11 +497,11 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move)
Entity *target = gDungeon->wildPokemon[i];
if (EntityExists(target) && target != pokemon && CanSeeTarget(pokemon, target))
{
if (target->axObj.info->offensiveStages[STAT_STAGE_ATK] >= MAX_STAT_STAGE)
if (GetEntInfo(target)->offensiveStages[STAT_STAGE_ATK] >= MAX_STAT_STAGE)
{
continue;
}
if (target->axObj.info->offensiveStages[STAT_STAGE_SP_ATK] < MAX_STAT_STAGE)
if (GetEntInfo(target)->offensiveStages[STAT_STAGE_SP_ATK] < MAX_STAT_STAGE)
{
break;
}
@ -521,11 +521,11 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move)
Entity *target = gDungeon->teamPokemon[i];
if (EntityExists(target) && target != pokemon && CanSeeTarget(pokemon, target))
{
if (target->axObj.info->offensiveStages[STAT_STAGE_ATK] >= MAX_STAT_STAGE)
if (GetEntInfo(target)->offensiveStages[STAT_STAGE_ATK] >= MAX_STAT_STAGE)
{
continue;
}
if (target->axObj.info->offensiveStages[STAT_STAGE_SP_ATK] < MAX_STAT_STAGE)
if (GetEntInfo(target)->offensiveStages[STAT_STAGE_SP_ATK] < MAX_STAT_STAGE)
{
break;
}
@ -543,8 +543,8 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move)
bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move)
{
EntityInfo *userData = user->axObj.info;
EntityInfo *targetData = target->axObj.info;
EntityInfo *userData = GetEntInfo(user);
EntityInfo *targetData = GetEntInfo(target);
s32 i;
if (targetData->immobilize.immobilizeStatus == STATUS_FROZEN && MoveCannotHitFrozen(move))
{
@ -622,7 +622,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move)
case MOVE_COTTON_SPORE:
case MOVE_SCARY_FACE:
case MOVE_STRING_SHOT:
if (target->axObj.info->speedStage <= 0)
if (GetEntInfo(target)->speedStage <= 0)
{
return FALSE;
}

View File

@ -152,7 +152,7 @@ extern void nullsub_69(Entity *, Entity *);
void sub_8075BA4(Entity *param_1, u8 param_2)
{
EntityInfo * entityInfo = param_1->axObj.info;
EntityInfo * entityInfo = GetEntInfo(param_1);
if ((param_2 != 0) && (entityInfo->volatileStatus.volatileStatus == STATUS_COWERING)) {
entityInfo->action.direction = (entityInfo->action.direction + 4) & DIRECTION_MASK;
@ -175,7 +175,7 @@ u8 sub_8075BF4(Entity * pokemon, s32 sleepTurns)
}
else
{
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
if(entityInfo->sleep.sleep != STATUS_NIGHTMARE && entityInfo->sleep.sleep != STATUS_SLEEP)
{
@ -202,7 +202,7 @@ void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, u8 displayMessage
if (!CannotSleep(pokemon,target,1,displayMessage)) {
sleep = target->axObj.info->sleep.sleep;
sleep = GetEntInfo(target)->sleep.sleep;
if (sleep == STATUS_SLEEPLESS) {
if (displayMessage)
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB380);
@ -267,7 +267,7 @@ void NightmareStatusTarget(Entity * pokemon, Entity * target, s32 turns)
hasNightmare = FALSE;
if (!CannotSleep(pokemon, target, 1, TRUE)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if (entityInfo->sleep.sleep != STATUS_SLEEPLESS) {
sub_8041EC8(target);
if (entityInfo->sleep.sleep != STATUS_NIGHTMARE) {
@ -304,7 +304,7 @@ void NappingStatusTarget(Entity * pokemon, Entity * target, s32 turns)
isSleeping = FALSE;
if (!CannotSleep(pokemon, target, 0, TRUE)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if (entityInfo->sleep.sleep != STATUS_SLEEPLESS) {
sub_8041ED8(target);
if (entityInfo->sleep.sleep == STATUS_NONE || entityInfo->sleep.sleep == STATUS_YAWNING) {
@ -341,7 +341,7 @@ void YawnedStatusTarget(Entity * pokemon, Entity * target, s32 turns)
if (CannotSleep(pokemon,target,1,TRUE)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if (entityInfo->sleep.sleep == STATUS_NONE) {
entityInfo->sleep.sleep = STATUS_YAWNING;
entityInfo->sleep.sleepTurns = turns;
@ -374,7 +374,7 @@ void SleeplessStatusTarget(Entity * pokemon, Entity * target)
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if ((entityInfo->sleep.sleep == STATUS_SLEEP) || (entityInfo->sleep.sleep == STATUS_NAPPING) || (entityInfo->sleep.sleep == STATUS_NIGHTMARE)) {
isAsleep = TRUE;
}
@ -406,7 +406,7 @@ void PausedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, s32 turns
if (!EntityExists(target)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if ((param_3 != 0) && (HasSafeguardStatus(pokemon,target,displayMessage))) {
return;
}
@ -440,7 +440,7 @@ void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessa
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if (!HasSafeguardStatus(pokemon,target,displayMessage)) {
if (HasAbility(target,ABILITY_OBLIVIOUS)) {
SetMessageArgument(gAvailablePokemonNames,target,0);
@ -481,7 +481,7 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis
}
if (!HasSafeguardStatus(pokemon,target,displayMessage)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument_2(gAvailablePokemonNames,entityInfo,0);
if (HasAbility(target, ABILITY_WATER_VEIL)) {
if (displayMessage)
@ -568,7 +568,7 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag
}
if (!HasSafeguardStatus(pokemon,target,displayMessage)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument_2(gAvailablePokemonNames,entityInfo,0);
if (HasHeldItem(target, ITEM_PECHA_SCARF)) {
if (displayMessage)
@ -657,7 +657,7 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM
}
if (!HasSafeguardStatus(pokemon,target,displayMessage)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument_2(gAvailablePokemonNames,entityInfo,0);
if (HasHeldItem(target, ITEM_PECHA_SCARF)) {
if (displayMessage)
@ -735,7 +735,7 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage)
}
SetMessageArgument(gAvailablePokemonNames, target, 0);
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if ((entityInfo->immobilize.immobilizeStatus != STATUS_FROZEN) && !HasSafeguardStatus(pokemon,target,displayMessage)) {
if (HasAbility(target, ABILITY_MAGMA_ARMOR)) {
@ -872,8 +872,8 @@ void WrapTarget(Entity * pokemon, Entity * target)
if (HasSafeguardStatus(pokemon, target, TRUE)) {
return;
}
pokemonEntityData = pokemon->axObj.info;
targetEntityInfo = target->axObj.info;
pokemonEntityData = GetEntInfo(pokemon);
targetEntityInfo = GetEntInfo(target);
if ((u8)(pokemonEntityData->immobilize.immobilizeStatus - 3U) > 1) {
if ((targetEntityInfo->immobilize.immobilizeStatus != STATUS_WRAP))
{
@ -927,7 +927,7 @@ void sub_8076CB4(s32 param_1)
{
entity = gDungeon->allPokemon[index];
if (EntityExists(entity)) {
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
if (entityInfo->unk9C == param_1) {
if ((u8)(entityInfo->immobilize.immobilizeStatus - 3U) < 2) {
entityInfo->immobilize.immobilizeStatus = STATUS_NONE;
@ -948,7 +948,7 @@ void PetrifiedStatusTarget(Entity * pokemon, Entity * target)
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) {
sub_8041C08(target);
targetEntityInfo = target->axObj.info;
targetEntityInfo = GetEntInfo(target);
if ((u8)(targetEntityInfo->immobilize.immobilizeStatus - 3U) < 2) {
sub_8076CB4(targetEntityInfo->unk9C);
}
@ -973,7 +973,7 @@ void PetrifiedStatusTarget(Entity * pokemon, Entity * target)
{
entity = gDungeon->teamPokemon[index];
if (EntityExists(entity)) {
entityInfo = entity->axObj.info;
entityInfo = GetEntInfo(entity);
if ((entityInfo->aiTarget.aiObjective == AI_CHASE_TARGET) && (entityInfo->aiTarget.aiTarget == target)) {
entityInfo->aiTarget.aiObjective = AI_STAND_STILL;
entityInfo->aiTarget.aiTarget = NULL;
@ -1017,7 +1017,7 @@ void LowerAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 de
}
else {
_08076EE4:
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
sub_8041F28(target,index);
if (decrement == 1) {
@ -1057,7 +1057,7 @@ void LowerDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 d
strcpy(gFormatItems,*gUnknown_80FC09C);
}
if (!param_5 || !sub_8071728(pokemon,target,displayMessage)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
sub_8041F4C(target,index);
if (decrement == 1) {
@ -1090,7 +1090,7 @@ void RaiseAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 in
if (!EntityExists(target)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
sub_8041F70(target,index);
if (index != STAT_STAGE_ATK) {
@ -1130,7 +1130,7 @@ void RaiseDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 i
if (!EntityExists(target)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
sub_8041F94(target,index);
if (index != STAT_STAGE_DEF) {

View File

@ -190,7 +190,7 @@ u8 GetFlashFireStatus(Entity *pokemon)
{
return FLASH_FIRE_STATUS_NONE;
}
if (pokemon->axObj.info->flashFireBoost > 1)
if (GetEntInfo(pokemon)->flashFireBoost > 1)
{
return FLASH_FIRE_STATUS_MAXED;
}
@ -212,16 +212,14 @@ static inline s32 UpdateFlashFireBoost_sub(EntityInfo * entityInfo)
void UpdateFlashFireBoost(Entity * pokemon, Entity *target)
{
EntityInfo * entityInfo;
EntityInfo * entityInfo_1;
s32 flashFireBoost;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo_1 = entityInfo;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
flashFireBoost = UpdateFlashFireBoost_sub(entityInfo);
if (entityInfo_1->flashFireBoost != flashFireBoost) {
entityInfo_1->flashFireBoost = flashFireBoost;
if (entityInfo->flashFireBoost != flashFireBoost) {
entityInfo->flashFireBoost = flashFireBoost;
sub_8041C58(target);
}
EntityUpdateStatusSprites(target);
@ -261,7 +259,7 @@ void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
oldMulti = entityInfo->offensiveMultipliers[statStage];
@ -312,7 +310,7 @@ void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStag
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
oldMulti = entityInfo->defensiveMultipliers[statStage];
@ -349,7 +347,7 @@ void RaiseAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
sub_8042040(target,statStage);
if (statStage != STAT_STAGE_ACCURACY) {
@ -389,7 +387,7 @@ void LowerAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage,
}
}
else {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
sub_8042060(target,statStage);
if (entityInfo->hitChanceStages[statStage] != 0) {
@ -417,7 +415,7 @@ void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage)
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC18);
}
else {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if(entityInfo->volatileStatus.volatileStatus != STATUS_CRINGE)
{
@ -455,7 +453,7 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag
else
{
bVar6 = TRUE;
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->nonVolatile.nonVolatileStatus != STATUS_PARALYSIS) {
entityInfo->nonVolatile.nonVolatileStatus = STATUS_PARALYSIS;
@ -507,7 +505,7 @@ void RaiseMovementSpeedTarget(Entity * pokemon, Entity * target, s32 turns, bool
if (turns == 0) {
turns = CalculateStatusTurns(target,gUnknown_80F4E40,FALSE) + 1;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
movSpeed = CalcSpeedStage(target);
if (movSpeed == MAX_SPEED_STAGE) {
@ -552,7 +550,7 @@ void LowerMovementSpeedTarget(Entity * pokemon, Entity * target, s32 levels, boo
if (HasSafeguardStatus(pokemon,target,displayMessage)) {
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
movSpeed = CalcSpeedStage(target);
if (movSpeed == 0) {
@ -610,7 +608,7 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage
else
{
sub_8041BE8(target);
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if (entityInfo->volatileStatus.volatileStatus != STATUS_CONFUSED) {
entityInfo->volatileStatus.volatileStatus = STATUS_CONFUSED;
entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E4C,TRUE) + 1;
@ -629,7 +627,7 @@ void CowerStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage)
EntityInfo *entityInfo;
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->volatileStatus.volatileStatus != STATUS_COWERING) {
entityInfo->volatileStatus.volatileStatus = STATUS_COWERING;
@ -658,7 +656,7 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo
return;
}
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
maxHPStat = entityInfo->maxHPStat;
HP = entityInfo->HP;
if (((entityInfo->HP == entityInfo->maxHPStat) && (0 < param_4)) || (param_3 == 0)) {
@ -727,12 +725,12 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo
void HandleScannerOrb(Entity* pokemon, Entity* target)
{
if (EntityExists(target)) {
if (target->axObj.info->scanning) {
if (GetEntInfo(target)->scanning) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEF0); // Item locations are already known
}
else
{
target->axObj.info->scanning = TRUE;
GetEntInfo(target)->scanning = TRUE;
nullsub_75(target);
SetMessageArgument(gAvailablePokemonNames, target, 0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEA0); // Item locations became evident
@ -752,12 +750,12 @@ void HandleStairsOrb(Entity* pokemon, Entity* target)
}
else
{
if (target->axObj.info->stairSpotter) {
if (GetEntInfo(target)->stairSpotter) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAF1C);
}
else
{
target->axObj.info->stairSpotter = TRUE;
GetEntInfo(target)->stairSpotter = TRUE;
nullsub_76(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEC8);
@ -772,12 +770,12 @@ void HandleStairsOrb(Entity* pokemon, Entity* target)
void HandleRadarOrb(Entity* pokemon, Entity* target)
{
if (EntityExists(target)) {
if (target->axObj.info->powerEars != 0) {
if (GetEntInfo(target)->powerEars != 0) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAFD0);
}
else
{
target->axObj.info->powerEars = TRUE;
GetEntInfo(target)->powerEars = TRUE;
nullsub_77(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAFAC);
@ -795,7 +793,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage)
s32 index;
if ((EntityExists(target)) && (GetEntityType(pokemon) == ENTITY_MONSTER)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
if (pokemon == target) {
pokemon = target;
if (displayMessage)
@ -831,7 +829,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage)
{
if (pokemon == gDungeon->allPokemon[index]) {
entityInfo->linked.unkD8 = index;
entityInfo2 = pokemon->axObj.info;
entityInfo2 = GetEntInfo(pokemon);
entityInfo->linked.unkD4 = entityInfo2->unk98;
}
}
@ -849,12 +847,12 @@ void sub_8078084(Entity * pokemon)
Entity *target;
s32 index;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
target = gDungeon->allPokemon[index];
if (EntityExists(target)) {
entityInfo2 = target->axObj.info;
entityInfo2 = GetEntInfo(target);
if((u8)(entityInfo2->linked.linkedStatus - 1) <= 1)
{
if(entityInfo2->linked.unkD4 == entityInfo->unk98)
@ -877,7 +875,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target)
if (((EntityExists(target)) && (GetEntityType(pokemon) == ENTITY_MONSTER)) &&
(GetEntityType(target) == ENTITY_MONSTER)) {
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
SetMessageArgument(gAvailablePokemonNames,pokemon,0);
linkedStatus = &entityInfo->linked.linkedStatus;
if (entityInfo->linked.linkedStatus != STATUS_DESTINY_BOND)
@ -900,7 +898,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target)
{
if (target == gDungeon->allPokemon[index]) {
entityInfo->linked.unkD8 = index;
entityInfo2 = target->axObj.info;
entityInfo2 = GetEntInfo(target);
entityInfo->linked.unkD4 = entityInfo2->unk98;
}
}
@ -914,7 +912,7 @@ void SureShotStatusTarget(Entity *pokemon, Entity * target, s32 turns)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->moveStatus.moveStatus != STATUS_SURE_SHOT) {
entityInfo->moveStatus.moveStatus = STATUS_SURE_SHOT;
@ -934,7 +932,7 @@ void WhifferStatusTarget(Entity *pokemon, Entity * target, s32 turns)
EntityInfo *entityInfo;
if (EntityExists(target) && !HasSafeguardStatus(pokemon, target, TRUE)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->moveStatus.moveStatus != STATUS_WHIFFER) {
entityInfo->moveStatus.moveStatus = STATUS_WHIFFER;
@ -954,7 +952,7 @@ void FixedDamageStatusTarget(Entity *pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->moveStatus.moveStatus != STATUS_SET_DAMAGE) {
entityInfo->moveStatus.moveStatus = STATUS_SET_DAMAGE;
@ -974,7 +972,7 @@ void FocusEnergyStatusTarget(Entity *pokemon, Entity * target)
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->moveStatus.moveStatus != STATUS_FOCUS_ENERGY) {
entityInfo->moveStatus.moveStatus = STATUS_FOCUS_ENERGY;
@ -999,7 +997,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3)
s32 index;
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) {
targetEntityInfo = target->axObj.info;
targetEntityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (targetEntityInfo->waitingStruct.waitingStatus == STATUS_DECOY) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB994);
@ -1009,7 +1007,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3)
{
entity = gDungeon->allPokemon[index];
if ((((EntityExists(entity)) && (target != entity)) &&
(u8)(entity->axObj.info->waitingStruct.waitingStatus - 2U) < 2)) {
(u8)(GetEntInfo(entity)->waitingStruct.waitingStatus - 2U) < 2)) {
SendWaitingEndMessage(pokemon,entity,STATUS_NONE);
sub_803E46C(0x2a);
}
@ -1020,7 +1018,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3)
SendWaitingEndMessage(pokemon,target, STATUS_DECOY);
}
targetEntityInfo->waitingStruct.waitingStatus = STATUS_DECOY;
targetEntityInfo->waitingStruct.enemyDecoy = pokemon->axObj.info->isNotTeamMember;
targetEntityInfo->waitingStruct.enemyDecoy = GetEntInfo(pokemon)->isNotTeamMember;
targetEntityInfo->waitingStruct.unkCA = param_3;
targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED0,TRUE) + 1;
targetEntityInfo->waitingStruct.curseDamageCountdown = 0;
@ -1032,7 +1030,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3)
{
entity2 = gDungeon->allPokemon[index];
if (EntityExists(entity2)) {
entityInfo = entity2->axObj.info;
entityInfo = GetEntInfo(entity2);
entityInfo->aiTarget.aiObjective = AI_STAND_STILL;
entityInfo->aiTarget.aiTarget = NULL;
entityInfo->aiTarget.aiTargetSpawnGenID = 0;
@ -1057,8 +1055,8 @@ void CurseStatusTarget(Entity *pokemon, Entity * target)
if ((EntityExists(pokemon) ) && (EntityExists(target))) {
pokemonEntityData = pokemon->axObj.info;
targetEntityInfo = target->axObj.info;
pokemonEntityData = GetEntInfo(pokemon);
targetEntityInfo = GetEntInfo(target);
if (MonsterIsType(pokemon, TYPE_GHOST)) {
if (HasSafeguardStatus(pokemon,target, TRUE)) {
return;
@ -1100,7 +1098,7 @@ void SnatchStatusTarget(Entity * pokemon, Entity * target)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
entity = gDungeon->allPokemon[index];
if ((EntityExists(entity)) && (entity->axObj.info->waitingStruct.waitingStatus == STATUS_SNATCH)) {
if ((EntityExists(entity)) && (GetEntInfo(entity)->waitingStruct.waitingStatus == STATUS_SNATCH)) {
SendWaitingEndMessage(pokemon, entity, STATUS_NONE);
}
}
@ -1126,7 +1124,7 @@ void TauntStatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->volatileStatus.volatileStatus != STATUS_TAUNTED) {
entityInfo->volatileStatus.volatileStatus = STATUS_TAUNTED;
@ -1146,7 +1144,7 @@ void HandleStockpile(Entity * pokemon, Entity * target)
EntityInfo *entityInfo;
if ((EntityExists(target))) {
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->stockpileStage < MAX_STOCKPILE_STAGE) {
entityInfo->stockpileStage++;
@ -1165,18 +1163,16 @@ void HandleStockpile(Entity * pokemon, Entity * target)
void InvisibleStatusTarget(Entity * pokemon, Entity * target)
{
EntityInfo * targetEntityInfo;
EntityInfo * targetEntityInfo_1;
if (EntityExists(target)) {
targetEntityInfo = target->axObj.info;
targetEntityInfo_1 = targetEntityInfo;
if (targetEntityInfo_1->transformStatus.transformStatus == STATUS_TRANSFORMED) {
targetEntityInfo = GetEntInfo(target);
if (targetEntityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) {
SendTransformEndMessage(pokemon,target);
}
SetMessageArgument(gAvailablePokemonNames,target,0);
if (targetEntityInfo_1->transformStatus.transformStatus != STATUS_INVISIBLE) {
targetEntityInfo_1->transformStatus.transformStatus = STATUS_INVISIBLE;
targetEntityInfo_1->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EE4,FALSE) + 1;
if (targetEntityInfo->transformStatus.transformStatus != STATUS_INVISIBLE) {
targetEntityInfo->transformStatus.transformStatus = STATUS_INVISIBLE;
targetEntityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EE4,FALSE) + 1;
sub_8041D84(target);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBA80);
}
@ -1193,7 +1189,7 @@ void PerishSongTarget(Entity * pokemon, Entity * target)
if (EntityExists(target) && !HasSafeguardStatus(pokemon, target, TRUE)) {
nullsub_82(target);
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
if (entityInfo->perishSongTurns == 0) {
entityInfo->perishSongTurns = CalculateStatusTurns(target,gUnknown_80F4EEC,FALSE) + 1;
@ -1212,7 +1208,7 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target)
int index;
EntityInfo *EntityInfo;
EntityInfo = target->axObj.info;
EntityInfo = GetEntInfo(target);
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) {
for(index = 0; index < MAX_MON_MOVES; index++)
{
@ -1239,15 +1235,15 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target)
}
}
void sub_8078A58(struct Entity *pokemon, struct Entity *target, s32 param_3, s32 param_4)
void sub_8078A58(Entity *pokemon, Entity *target, s32 param_3, s32 param_4)
{
struct EntityInfo *targetInfo;
EntityInfo *targetInfo;
FixedPoint bellyBefore;
if (!EntityExists(target))
return;
targetInfo = target->axObj.info;
targetInfo = GetEntInfo(target);
if (param_4 != 0) {
FixedPoint sp0 = IntToFixedPoint(param_4);
@ -1300,7 +1296,7 @@ void sub_8078B5C(Entity *pokemon, Entity *target, u32 bellyIncrement, s32 maxBel
if (!EntityExists(target)) {
return;
}
targetInfo = target->axObj.info;
targetInfo = GetEntInfo(target);
if ((!targetInfo->isTeamLeader) && (HasHeldItem(target,0x1b))) {
if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBEA0);
return;

View File

@ -209,7 +209,7 @@ bool8 sub_805B074(Entity * pokemon, Entity * target, Move *move, s32 param_4)
bool8 sub_805B0BC(Entity * pokemon, Entity * target)
{
sub_807CD9C(pokemon, target, pokemon->axObj.info->action.direction);
sub_807CD9C(pokemon, target, GetEntInfo(pokemon)->action.direction);
return TRUE;
}
@ -219,7 +219,7 @@ bool8 HandleColorChange(Entity * pokemon, Entity * target)
const char *typeString;
EntityInfo *entityInfo;
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
newType = gDungeonCamouflageTypes[gDungeon->tileset];
if (HasAbility(target, ABILITY_FORECAST)) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsTypeSwitchMessage);
@ -287,7 +287,7 @@ bool8 SpikesMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_
bool8 isNotTeamMember;
trapLaid = FALSE;
isNotTeamMember = pokemon->axObj.info->isNotTeamMember;
isNotTeamMember = GetEntInfo(pokemon)->isNotTeamMember;
uVar2 = 1;
if (isNotTeamMember) {
@ -311,7 +311,7 @@ bool8 sub_805B264(Entity * pokemon, Entity * target, Move *move, s32 param_4)
s32 iVar5;
EntityInfo *entityInfo;
entityInfo = target->axObj.info;
entityInfo = GetEntInfo(target);
r3 = gUnknown_202F224;
r6 = FALSE;
@ -403,7 +403,7 @@ bool8 sub_805B3FC(Entity * pokemon,Entity * target,Move *move, s32 param_4, s32
if (HandleDamagingMove(pokemon,target,move,0x100,param_5) != 0) {
flag = TRUE;
if (sub_805727C(pokemon,pokemon,gUnknown_80F4DCE) != 0) {
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
RaiseAttackStageTarget(pokemon,pokemon,param_4,1);
SetExpMultplier(entityInfo);
}
@ -427,8 +427,8 @@ bool8 MimicMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4
bool8 mimicSuccess;
mimicSuccess = FALSE;
entityInfo = pokemon->axObj.info;
targetEntityInfo = target->axObj.info;
entityInfo = GetEntInfo(pokemon);
targetEntityInfo = GetEntInfo(target);
moveCounter = 0;
for(moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++)
@ -464,7 +464,7 @@ bool8 sub_805B53C(Entity * pokemon, Entity * target, Move *move, s32 param_4)
EntityInfo *entityInfo;
local_24 = 0;
entityInfo = pokemon->axObj.info;
entityInfo = GetEntInfo(pokemon);
r5 = 1;
index = 0;
if (0 <= gUnknown_80F55EC[0]) {
@ -641,7 +641,7 @@ bool8 sub_805B968(Entity * pokemon, Entity * target, Move * move, s32 param_4)
if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
if (sub_8057308(pokemon,0) != 0) {
entityHP = pokemon->axObj.info->maxHPStat;
entityHP = GetEntInfo(pokemon)->maxHPStat;
if (entityHP < 0) {
entityHP = entityHP + 3;
}
@ -696,10 +696,10 @@ bool8 sub_805BA50(Entity * pokemon, Entity * target, Move *move, s32 param_4)
if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
if (sub_805727C(pokemon,target, 0) != 0) {
iVar2 = pokemon->axObj.info;
iVar3 = pokemon->axObj.info;
iVar5 = target->axObj.info;
iVar6 = target->axObj.info;
iVar2 = GetEntInfo(pokemon);
iVar3 = GetEntInfo(pokemon);
iVar5 = GetEntInfo(target);
iVar6 = GetEntInfo(target);
SetMessageArgument(gAvailablePokemonNames, pokemon, 0);
SetMessageArgument(gAvailablePokemonNames + 0x50, target, 0);
if (HasAbility(target, ABILITY_STICKY_HOLD)) {
@ -808,8 +808,8 @@ bool8 sub_805BC98(Entity * pokemon, Entity * target, Move *move, s32 param_4)
local_28 = 0;
local_27 = 0;
entityInfo = pokemon->axObj.info;
targetHP = target->axObj.info->HP - 1;
entityInfo = GetEntInfo(pokemon);
targetHP = GetEntInfo(target)->HP - 1;
if (targetHP < 0) {
targetHP = 0;
}
@ -857,8 +857,8 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_
bool8 didTransfer;
didTransfer = FALSE;
if (target->axObj.info->isNotTeamMember) {
entityInfo = target->axObj.info;
if (GetEntInfo(target)->isNotTeamMember) {
entityInfo = GetEntInfo(target);
targetID = entityInfo->id;
oldID = entityInfo->id;
SetMessageArgument(gAvailablePokemonNames,target,0);
@ -1007,7 +1007,7 @@ bool8 sub_805C080(Entity * pokemon, Entity *target, Move *move, s32 param_4)
s32 index;
foundTarget = FALSE;
if (pokemon->axObj.info->isNotTeamMember) {
if (GetEntInfo(pokemon)->isNotTeamMember) {
possibleTargets = gDungeon->wildPokemon;
numPossibleTargets = DUNGEON_MAX_WILD_POKEMON;
}
@ -1077,7 +1077,7 @@ bool8 sub_805C208(Entity *pokemon, Entity *target, Move *move, u32 param_4)
u8 local_24;
local_24 = 0;
targetSize = GetSize(target->axObj.info->apparentID);
targetSize = GetSize(GetEntInfo(target)->apparentID);
sub_806F370(pokemon,target,targetSize,1,&local_24,GetMoveType(move),sub_8057600(move,param_4),0,1,0);
local_24 = local_24 == 0;
@ -1106,7 +1106,7 @@ bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4)
Position tileCoords;
filledInTile = FALSE;
targetInfo = target->axObj.info;
targetInfo = GetEntInfo(target);
if (IsBossFight()) {
TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FD0B8);
return FALSE;
@ -1149,7 +1149,7 @@ bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4)
bool8 TrapperOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4)
{
u32 var;
var = (target->axObj.info->isNotTeamMember ? 2 : 1);
var = (GetEntInfo(target)->isNotTeamMember ? 2 : 1);
sub_807FC3C(&target->pos, NUM_TRAPS, var);
return TRUE;
}
@ -1159,7 +1159,7 @@ bool8 sub_805C3F8(Entity *pokemon, Entity *target, Move *move, s32 param_4)
Item stack;
Position posStruct = target->pos;
if(target->axObj.info->clientType != CLIENT_TYPE_NONE)
if(GetEntInfo(target)->clientType != CLIENT_TYPE_NONE)
{
TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FF678);
return FALSE;

View File

@ -27,7 +27,7 @@ extern char *gPtrMoveInterruptedMessage[];
bool8 HasStatusAffectingActions(Entity *pokemon)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
SetMessageArgument(gAvailablePokemonNames, pokemon, 0);
SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN);
switch (pokemonInfo->sleep.sleep)
@ -116,7 +116,7 @@ bool8 sub_80701A4(Entity *pokemon)
EntityInfo * pokemonInfo;
u8 *r7;
pokemonInfo = pokemon->axObj.info;
pokemonInfo = GetEntInfo(pokemon);
flag = FALSE;
SetMessageArgument(gAvailablePokemonNames, pokemon, 0);
SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN);

View File

@ -42,7 +42,7 @@ s32 sub_8070828(Entity *pokemon, bool8 displayMessage)
if ((HasAbility(pokemon, ABILITY_CHLOROPHYLL)) && (GetApparentWeather(pokemon) == WEATHER_SUNNY)) {
flag = TRUE;
}
if (displayMessage && SetVisualFlags(pokemon->axObj.info, 0x40, flag)) {
if (displayMessage && SetVisualFlags(GetEntInfo(pokemon), 0x40, flag)) {
sub_80429B4(pokemon);
TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FEE80);
}
@ -128,7 +128,7 @@ void sub_80709C8(u8 *buffer, EntityInfo *entityInfo)
bool8 HasNegativeStatus(Entity *pokemon)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
s32 i;
if (pokemonInfo->sleep.sleep == STATUS_SLEEP ||
pokemonInfo->sleep.sleep == STATUS_NIGHTMARE ||
@ -168,9 +168,9 @@ bool8 HasNegativeStatus(Entity *pokemon)
bool8 IsSleeping(Entity *pokemon)
{
if (pokemon->axObj.info->sleep.sleep != STATUS_SLEEP &&
pokemon->axObj.info->sleep.sleep != STATUS_NAPPING &&
pokemon->axObj.info->sleep.sleep != STATUS_NIGHTMARE)
if (GetEntInfo(pokemon)->sleep.sleep != STATUS_SLEEP &&
GetEntInfo(pokemon)->sleep.sleep != STATUS_NAPPING &&
GetEntInfo(pokemon)->sleep.sleep != STATUS_NIGHTMARE)
{
return FALSE;
}

View File

@ -5,7 +5,7 @@
void TargetTileInFront(Entity *pokemon)
{
EntityInfo *pokemonInfo = pokemon->axObj.info;
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
pokemonInfo->targetPos.x = pokemon->pos.x + gAdjacentTileOffsets[pokemonInfo->action.direction].x;
pokemonInfo->targetPos.y = pokemon->pos.y + gAdjacentTileOffsets[pokemonInfo->action.direction].y;
}

View File

@ -1932,7 +1932,7 @@ void sub_8007AA4(UnkTextStruct1 *a0, u32 a1, s32 x, s32 y, s32 a4, u32 color)
r4 = &a0[a1];
ip = gUnknown_80B853C[color & 0xF] + 0x11111111;
#ifndef NONMATCHING
asm("":::"r8");
asm("" : : : "r8");
#endif // NONMATCHING
dataLOL = gUnknown_80B8848;
a4++; a4--;

View File

@ -497,7 +497,7 @@ void HandleGrimyTrap(Entity *pokemon, Entity *target)
badFoodCount = 0;
if (target != NULL) {
info = target->axObj.info;
info = GetEntInfo(target);
counter = 0;
if (info->isTeamLeader) {
for(index = 0; index < INVENTORY_SIZE; index++)
@ -546,7 +546,7 @@ void HandlePitfallTrap(Entity *pokemon, Entity *target, Tile *tile)
}
else
{
info = target->axObj.info;
info = GetEntInfo(target);
if (sub_8045888(target)) {
SetTrap(tile, 0x1B);
flag = TRUE;
@ -645,7 +645,7 @@ void HandlePPZeroTrap(Entity *param_1,Entity *param_2)
if (param_2 != NULL) {
info = param_2->axObj.info;
info = GetEntInfo(param_2);
counter = 0;
for(i = 0; i < MAX_MON_MOVES; move++, i++)
{
@ -687,7 +687,7 @@ void HandleSealTrap(Entity *param_1,Entity *param_2)
if (param_2 != NULL && !HasSafeguardStatus(param_1, param_2, TRUE)) {
info = param_2->axObj.info;
info = GetEntInfo(param_2);
counter = 0;
for(i = 0; i < MAX_MON_MOVES;i++)
{

View File

@ -110,7 +110,7 @@ void HandleTripTrap(Entity *pokemon, Entity *target)
sub_806CDD4(target, 6, NUM_DIRECTIONS);
sub_803E708(0x10, 0x55);
sub_806CE68(target, NUM_DIRECTIONS);
info = target->axObj.info;
info = GetEntInfo(target);
if ((info->heldItem).flags & ITEM_FLAG_EXISTS) {
item = (info->heldItem);
(info->heldItem).flags = 0;
@ -304,7 +304,7 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2)
sub_8083060(param_1,0xaa);
sub_8083060(param_1,0x55);
if (EntityExists(param_2)) {
info = param_2->axObj.info;
info = GetEntInfo(param_2);
sub_8082FA8(param_1,&uStack_ac,1);
sub_8082FA8(param_1,&param_2->pos.x,1);
sub_8082FA8(param_1,&param_2->pos.y,1);

View File

@ -92,8 +92,8 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct
bVar4 = FALSE;
normalOrFightingType = FALSE;
pokemonInfo = pokemon->axObj.info;
targetInfo = target->axObj.info;
pokemonInfo = GetEntInfo(pokemon);
targetInfo = GetEntInfo(target);
sub_800A020(param_1,1);
param_5->unkD = 0;
param_5->unkE = 0;
@ -264,8 +264,8 @@ s32 WeightWeakTypePicker(Entity *user, Entity *target, u8 moveType)
{
checkExposed = TRUE;
}
userData = user->axObj.info;
targetData = target->axObj.info;
userData = GetEntInfo(user);
targetData = GetEntInfo(target);
if (moveType == TYPE_FIRE && GetFlashFireStatus(target) != FLASH_FIRE_STATUS_NONE)
{
return 0;