diff --git a/include/axdata.h b/include/axdata.h index c1227e991..9613f0600 100644 --- a/include/axdata.h +++ b/include/axdata.h @@ -81,15 +81,14 @@ struct axObject { /* 0x0 */ axdata axdata; /* 0x3C */ OpenedFile *spriteFile; // This might be a unkStruct_202EE8C instead and unkStruct_202EE8C.unk0 might be a OpenedFile* etc. See sub_8010F28 - u16 unk40_maybeAnimTimer; + s16 unk40_maybeAnimTimer; u8 unk42_animId1; u8 unk43_animId2; - u8 unk44; + u8 unk44_direction1; u8 unk45_orientation; u8 unk46; u8 unk47; - u8 unk48; - u8 fill49[0x4C - 0x49]; + /* 0x48 */ struct EntityInfo* info; }; // size: ? diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index 1edccca96..73b4f9d24 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -6,6 +6,7 @@ #include "sprite.h" #include "structs/str_items.h" #include "structs/str_moves.h" +#include "axdata.h" #include "number_util.h" @@ -351,16 +352,7 @@ typedef struct Entity // The global spawn index counter starts at 10. Each Pokémon that spawns increments the counter and // gets assigned the current counter value as its spawn index. /* 0x26 */ u16 spawnGenID; - /* 0x28*/ EntitySpriteInfo spriteInfo; - OpenedFile *sprite; - s16 unk68; - u8 unk6A; - u8 unk6B; - /* 0x6C */ u8 direction; - /* 0x6D */ u8 direction2; // Duplicate of 0x6C? - u8 unk6E; - u8 unk6F; - /* 0x70 */ EntityInfo *info; + /* 0x28 */ struct axObject axObj; } Entity; enum EntityType @@ -460,7 +452,7 @@ static inline void SetExpMultplier(EntityInfo *info) static inline EntityInfo *GetEntInfo(Entity *ent) { - return ent->info; + return ent->axObj.info; } #endif diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index 99624e3d9..99fdcf185 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -145,7 +145,7 @@ void sub_804178C(u8 param_1) u32 EntityGetStatusSprites(Entity *entity) { - return entity->info->statusIcons; + return entity->axObj.info->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->info; + entityInfo = entity->axObj.info; if(param_1) { entityInfo->unk14C = 1; @@ -177,7 +177,7 @@ void EntityUpdateStatusSprites(Entity *entity) u8 temp; if (EntityExists(entity)) { - entityInfo = entity->info; + entityInfo = entity->axObj.info; spriteStatus = 0; flag = TRUE; @@ -501,7 +501,7 @@ void sub_8041D5C(Entity *pokemon) if (!sub_8042768(pokemon)) return; - sub_803ED30(pokemon->info->stockpileStage, pokemon, 1, 11); + sub_803ED30(pokemon->axObj.info->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->info->isNotTeamMember) + if(target->axObj.info->isNotTeamMember) PlaySoundEffect(0x157); else PlaySoundEffect(0x156); diff --git a/src/code_804267C.c b/src/code_804267C.c index b6bf98d48..36f88b077 100644 --- a/src/code_804267C.c +++ b/src/code_804267C.c @@ -81,7 +81,7 @@ void sub_8042730(Entity *a0, void *unused) sub_806CDD4(a0, 8, 8); for (i = 0; i < 100; i++) { sub_803E46C(0x51); - if ((a0->spriteInfo.unk18 & 3) != 0 || a0->unk6B != 8) + if (((*(struct EntitySpriteInfo *)&a0->axObj.axdata).unk18 & 3) != 0 || a0->axObj.unk43_animId2 != 8) break; } } @@ -108,7 +108,7 @@ void sub_80427AC(void) for (i = 0; i < 20; i++) { entity = gDungeon->allPokemon[i]; if (EntityExists(entity)) { - enInfo = entity->info; + enInfo = entity->axObj.info; if (enInfo->unkF3) { enInfo->unkF3 = FALSE; sub_80429A0(entity); diff --git a/src/code_8042B34.c b/src/code_8042B34.c index b6c239c41..f29587811 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -232,7 +232,9 @@ void sub_8042EC8(Entity *a0, s32 a1) EntityInfo *entInfo = GetEntInfo(a0); if (strPtr->unk8 != -1) { - sub_800569C(&sp4, &a0->spriteInfo, strPtr->unk8); + sub_800569C(&sp4, + &(*(struct EntitySpriteInfo *)&a0->axObj.axdata), + strPtr->unk8); } sub_800EB24(strPtr->unk0, &sp8, &sp4,a1, entInfo->action.direction); diff --git a/src/code_8044CC8.c b/src/code_8044CC8.c index c60ed15c6..63e25e69e 100644 --- a/src/code_8044CC8.c +++ b/src/code_8044CC8.c @@ -41,13 +41,13 @@ Item * sub_8044CC8(Entity *param_1, unkStruct_8044CC8 *param_2) } else { if (param_2->actionUseIndex == 0x81) { - info = param_1->info; + info = param_1->axObj.info; } else { if (3 < (u8)(param_2->actionUseIndex + 0x70)) { return NULL; } - info = gDungeon->teamPokemon[param_2->actionUseIndex - 0x90]->info; + info = gDungeon->teamPokemon[param_2->actionUseIndex - 0x90]->axObj.info; } 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->info; + EntityInfo *info = entity->axObj.info; 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->info; + EntityInfo *info = entity->axObj.info; 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->info; + info = entity->axObj.info; 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->info; + info = entity->axObj.info; 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->info; + info = param_1->axObj.info; action = &(info->action).action; if ((param_2 == 0) || (sub_8045888(param_1))) { diff --git a/src/code_8045A00.c b/src/code_8045A00.c index 38cdf10e0..a3f018671 100644 --- a/src/code_8045A00.c +++ b/src/code_8045A00.c @@ -69,7 +69,7 @@ void SetMessageArgument(char buffer[], Entity *entity, u32 param_3) switch(GetEntityType(entity)) { case ENTITY_MONSTER: - SetMessageArgument_2(buffer, entity->info, param_3); + SetMessageArgument_2(buffer, entity->axObj.info, param_3); break; case ENTITY_ITEM: sub_8045BF8(buffer, GetItemData_1(entity)); diff --git a/src/code_8048480.c b/src/code_8048480.c index 985fc2e6e..07a0819ff 100644 --- a/src/code_8048480.c +++ b/src/code_8048480.c @@ -165,8 +165,8 @@ bool8 sub_8047930(Entity *pokemon, Entity *target) { bool8 flag; - if (((target->info->shopkeeper == TRUE) || - (target->info->clientType == 4)) || (target->info->clientType == CLIENT_TYPE_CLIENT)) { + if (((target->axObj.info->shopkeeper == TRUE) || + (target->axObj.info->clientType == 4)) || (target->axObj.info->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->info; + info = target->axObj.info; 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->info->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) + if(target->axObj.info->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->info->nonVolatile.nonVolatileStatus - 2) <= 1) + if((u8)(target->axObj.info->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->info->nonVolatile.nonVolatileStatus == STATUS_BURN) + if(target->axObj.info->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->info; - if (target->info->isTeamLeader) + EntityInfo *entityInfo = target->axObj.info; + if (target->axObj.info->isTeamLeader) sub_8078A58(pokemon, target, 0, 5); else { - entityInfo = target->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = entity->axObj.info; 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->info; + targetInfo = target->axObj.info; 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->info; + entityInfo = entity->axObj.info; 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->info; + pEVar6 = entity->axObj.info; 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->info; + entityInfo = entity->axObj.info; 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->info; + entity1Info = entity1->axObj.info; flag = TRUE; if(CheckVariousStatuses2(entity1, FALSE)) { @@ -976,7 +976,7 @@ bool32 sub_8048B9C(Entity *entity,Item *param_2) else { while( TRUE ) { - entityInfo = entity2->info; + entityInfo = entity2->axObj.info; actionContainer = *actionPointer; goto _clear; _load: @@ -1032,7 +1032,7 @@ bool8 sub_8048D50(Entity * pokemon, Item *item) { EntityInfo *entityInfo; - entityInfo = pokemon->info; + entityInfo = pokemon->axObj.info; if ((item->flags & ITEM_FLAG_STICKY) != 0) { sub_8045BF8(gFormatItems, item); diff --git a/src/code_805D8C8.c b/src/code_805D8C8.c index 26b8ea822..ad0cda90c 100644 --- a/src/code_805D8C8.c +++ b/src/code_805D8C8.c @@ -23,7 +23,7 @@ void sub_8068768(void) entity = gDungeon->allPokemon[i]; if (entity != NULL && EntityExists(entity)) - LoadPokemonSprite(entity->info->apparentID, FALSE); + LoadPokemonSprite(entity->axObj.info->apparentID, FALSE); } } diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index 1bee838c8..ed3693088 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -1349,7 +1349,7 @@ void sub_805E738(Entity *a0) { Tile *tile; s32 i, j; - EntityInfo *entityInfo = a0->info; + EntityInfo *entityInfo = a0->axObj.info; 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->info; + EntityInfo *tileMonsterInfo = tile->monster->axObj.info; if (CanSeeTarget(a0, tile->monster)) { if (i != 0 || tileMonsterInfo->isNotTeamMember) { r9 = TRUE; @@ -1370,7 +1370,7 @@ void sub_805E738(Entity *a0) } } if (r9) { - a0->info->action.direction = direction & DIRECTION_MASK; + a0->axObj.info->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->info->action.direction; + s32 direction = leader->axObj.info->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->info->transformStatus.transformStatus != STATUS_MOBILE && !HasHeldItem(leader, ITEM_MOBILE_SCARF)) + if (IQSkillIsEnabled(leader, IQ_SUPER_MOBILE) && leader->axObj.info->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->info->isNotTeamMember && r4->info->clientType != 1 && r4->info->shopkeeper != 1) + if (r4->axObj.info->isNotTeamMember && r4->axObj.info->clientType != 1 && r4->axObj.info->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->info; - EntityInfo *leaderInfo = leader->info; + EntityInfo *r8 = r7->axObj.info; + EntityInfo *leaderInfo = leader->axObj.info; 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->info->isTeamLeader) { + if (teamMon->axObj.info->isTeamLeader) { r7 = i; break; } @@ -2226,7 +2226,7 @@ void DrawFieldMenu(u8 a0) sub_80073E0(0); if (a0) { u32 hours, minutes, seconds; - EntityInfo *leaderInfo = GetLeader()->info; + EntityInfo *leaderInfo = GetLeader()->axObj.info; 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->info; + EntityInfo *monInfo = teamMon->axObj.info; 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->info; + EntityInfo *a0Info = a0->axObj.info; 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->info; + EntityInfo *monInfo = teamMon->axObj.info; 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->info; + a1Info = a1->axObj.info; 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->info->heldItem; + Item *item = &a1->axObj.info->heldItem; SetMessageArgument_2(gAvailablePokemonNames, a1Info, 0); PrintFormatStringOnWindow(x, 0, gUnknown_80FE940, 0, 0); if (item->flags & ITEM_FLAG_EXISTS) { @@ -2788,8 +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->info->heldItem; - SetMessageArgument_2(gAvailablePokemonNames, chosenTeamMember->info, 0); + Item *item = &chosenTeamMember->axObj.info->heldItem; + SetMessageArgument_2(gAvailablePokemonNames, + chosenTeamMember->axObj.info, 0); PrintFormatStringOnWindow(x, 0, gUnknown_80FE940, 0, 0); if (item->flags & ITEM_FLAG_EXISTS) { gUnknown_202EE10.unk1A++; @@ -2885,7 +2886,7 @@ void sub_8060900(Entity *a0) { u16 val_sub8044DC8; Item *item = sub_8044CC8(a0, &sUnknownActionUnk4, 0xA); - EntityInfo *a0Info = a0->info; + EntityInfo *a0Info = a0->axObj.info; gUnknown_202EE6C = 0; if (sUnknownActionUnk4.actionUseIndex < 144) { @@ -2954,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->info; + EntityInfo *teamMonInfo = teamMon->axObj.info; teamMonInfo->unk157 = FALSE; if (!CheckVariousConditions(teamMon)) { r8 = TRUE; @@ -3012,7 +3013,7 @@ void sub_8060900(Entity *a0) Entity *teamMon = gDungeon->teamPokemon[index]; if (EntityExists(teamMon)) { bool32 r5, r6, r4; - EntityInfo *teamMonInfo = teamMon->info; + EntityInfo *teamMonInfo = teamMon->axObj.info; r5 = FALSE; if (CheckVariousConditions(teamMon)) @@ -3113,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->info->heldItem.flags & ITEM_FLAG_EXISTS) { + if (EntityExists(teamMon) && teamMon->axObj.info->heldItem.flags & ITEM_FLAG_EXISTS) { a0[count++] = i + MAX_TEAM_MEMBERS; } } @@ -3159,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->info->unk157 = TRUE; + teamMon->axObj.info->unk157 = TRUE; } } @@ -3234,7 +3235,7 @@ bool8 sub_8060E38(Entity *a0) sTeamMenuChosenId = gUnknown_202EE10.menuIndex; sub_806145C(&sp); if (r10) { - EntityInfo *info = a0->info; + EntityInfo *info = a0->axObj.info; SetMonsterActionFields(&info->action, 0x1B); info->action.unk4[0].actionUseIndex = sp.unk4[sp.unk0]; ret = FALSE; @@ -3255,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->info->action, &sp); + sub_80615B4(&a0->axObj.info->action, &sp); sub_8083D08(); r4 = FALSE; break; @@ -3316,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->info; + monInfo = teamMon->axObj.info; a0->unk14[count] = monInfo->unk157; if (pos.x == teamMon->pos.x && pos.y == teamMon->pos.y && sTeamMenuChosenId < 0) { sTeamMenuChosenId = count; @@ -3378,7 +3379,7 @@ void DrawFieldTeamMenu(struct UnkFieldTeamMenuStruct *a0, UnkTextStruct3 *a1, bo Entity *teamMon = gDungeon->teamPokemon[id]; if (EntityExists(teamMon)) { - EntityInfo *monInfo = teamMon->info; + EntityInfo *monInfo = teamMon->axObj.info; s32 color = (a0->unk14[i] != 0) ? 6 : 2; sub_8070968(gAvailablePokemonNames, monInfo, color); @@ -3525,7 +3526,7 @@ void ShowTacticsMenu(ActionContainer *a0) SetTxtStruct(&sp); teamMon = gDungeon->teamPokemon[a0->unk4[0].actionUseIndex]; - monInfo = teamMon->info; + monInfo = teamMon->axObj.info; menuIndex = 0; scrollFirstId = 0; while (1) { diff --git a/src/code_8066D04.c b/src/code_8066D04.c index aa47d834c..252f6ea8c 100644 --- a/src/code_8066D04.c +++ b/src/code_8066D04.c @@ -41,7 +41,7 @@ extern void sub_8045DB4(Position *, u32); void HandlePickUpPlayerAction(Entity *entity) { - entity->info->action.unk4[0].actionUseIndex = 1; + entity->axObj.info->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->info; - info2 = entity->info; + info1 = param_1->axObj.info; + info2 = entity->axObj.info; item = sub_8044D90(param_1,0,2); if((info1->action).unk4[0].actionUseIndex == 0x80) @@ -200,8 +200,8 @@ void HandleTakeItemAction(Entity *param_1) Item item; entity = sub_8044DA4(param_1,0); - info = entity->info; - info2 = entity->info; + info = entity->axObj.info; + info2 = entity->axObj.info; heldItem = &info->heldItem; if ((gTeamInventoryRef->teamItems[ITEM_POWER_BAND].flags & ITEM_FLAG_EXISTS)) { TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D60); @@ -284,7 +284,7 @@ void HandleUseItemAction(Entity *param_1) Entity *entity; entity = sub_8044DA4(param_1,0); - entity->info->useHeldItem = TRUE; + entity->axObj.info->useHeldItem = TRUE; } void HandlePlaceItemAction(Entity *param_1) @@ -300,7 +300,7 @@ void HandlePlaceItemAction(Entity *param_1) entity = param_1; - info = entity->info; + info = entity->axObj.info; item = sub_8044D90(entity,0,4); sub_8045BF8(gFormatItems,item); if (info->action.unk4[0].actionUseIndex == 0x80) { diff --git a/src/code_8069D4C.c b/src/code_8069D4C.c index 528823965..6846e9405 100644 --- a/src/code_8069D4C.c +++ b/src/code_8069D4C.c @@ -7,7 +7,7 @@ u32 sub_8069D18(Position *pos,Entity *entity) { EntityInfo *info; - info = entity->info; + info = entity->axObj.info; 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->info; + info = target->axObj.info; r0->id = info->id; r0->pos = target->pos; diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 9af6217c5..64bb6359c 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -51,7 +51,7 @@ void sub_8069E0C(Entity *pokemon) s32 index; EntityInfo *entityInfo; - entityInfo = pokemon->info; + entityInfo = pokemon->axObj.info; 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->info; + iVar7 = pokemon->axObj.info; iVar8 = iVar7; - iVar6 = target->info; + iVar6 = target->axObj.info; 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->info, entityInfo->protection.protectionStatus == STATUS_CONVERSION2)) { + && (entityInfo = target->axObj.info, 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->info; + entityInfo = pokemon->axObj.info; 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->info; + entityInfo = pokemon->axObj.info; 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->info; + entityInfo = target->axObj.info; isNotTeamMember = (!entityInfo->isNotTeamMember); } if (isNotTeamMember && (!sub_8045888(target))) { @@ -320,7 +320,7 @@ void sub_806A390(Entity *pokemon) EntityInfo *info; Move *move; - info = pokemon->info; + info = pokemon->axObj.info; for(index = 0; index < MAX_MON_MOVES; index++) { move = &info->moves.moves[index]; diff --git a/src/code_806CD90.c b/src/code_806CD90.c index aa1401b5b..c536c4110 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -53,7 +53,7 @@ void sub_806CC10(void) entity = gDungeon->allPokemon[i]; if (EntityExists(entity)) { - entityInfo = entity->info; + entityInfo = entity->axObj.info; if (entityInfo->unk166 != 0) { entityInfo->unk166--; @@ -83,25 +83,32 @@ void sub_806CCB4(Entity *entity, u8 a1) bool8 flag; EntityInfo *info; - info = entity->info; + info = entity->axObj.info; flag = gDungeon->unk181e8.hallucinating; if (entity == gDungeon->unk181e8.cameraTarget) flag = FALSE; - entity->unk6B = a1; - entity->unk6A = a1; - entity->direction2 = info->action.direction; - entity->direction = info->action.direction; - entity->unk6F = 0; - sVar1 = entity->unk68; + entity->axObj.unk43_animId2 = a1; + entity->axObj.unk42_animId1 = a1; + entity->axObj.unk45_orientation = info->action.direction; + entity->axObj.unk44_direction1 = info->action.direction; + entity->axObj.unk47 = 0; + sVar1 = entity->axObj.unk40_maybeAnimTimer; if (info->waitingStruct.waitingStatus != STATUS_DECOY && !flag) - AxResInitFile(&entity->spriteInfo, entity->sprite, entity->unk6A, entity->direction, sVar1, Rand32Bit() & 3, FALSE); + AxResInitFile(&(*(struct EntitySpriteInfo *)&entity->axObj.axdata), + entity->axObj.spriteFile, entity->axObj.unk42_animId1, + entity->axObj.unk44_direction1, sVar1, + Rand32Bit() & 3, FALSE); else - AxResInitFile(&entity->spriteInfo, GetSpriteData(MONSTER_DECOY), entity->unk6A, entity->direction, sVar1, Rand32Bit() & 3, FALSE); + AxResInitFile(&(*(struct EntitySpriteInfo *)&entity->axObj.axdata), + GetSpriteData(MONSTER_DECOY), + entity->axObj.unk42_animId1, + entity->axObj.unk44_direction1, sVar1, Rand32Bit() & 3, + FALSE); - entity->unk6E = 0; + entity->axObj.unk46 = 0; } void sub_806CD90(void) @@ -120,17 +127,17 @@ void sub_806CD90(void) void sub_806CDD4(Entity *entity, u8 a1, u32 direction) { if (GetEntityType(entity) == ENTITY_MONSTER) { - entity->unk6A = a1; + entity->axObj.unk42_animId1 = a1; if (direction < NUM_DIRECTIONS) - entity->direction = direction; + entity->axObj.unk44_direction1 = direction; } } void sub_806CDFC(Entity *entity, u8 a1, u32 direction) { if (GetEntityType(entity) == ENTITY_MONSTER) { - if (entity->unk6B == a1 && entity->direction2 == direction) + if (entity->axObj.unk43_animId2 == a1 && entity->axObj.unk45_orientation == direction) return; sub_806CDD4(entity, a1, direction); } @@ -139,11 +146,11 @@ void sub_806CDFC(Entity *entity, u8 a1, u32 direction) void sub_806CE34(Entity *entity, u32 newDir) { if (GetEntityType(entity) == ENTITY_MONSTER) { - entity->unk6A = sub_806CEBC(entity); + entity->axObj.unk42_animId1 = sub_806CEBC(entity); if (newDir < NUM_DIRECTIONS) { - entity->info->action.direction = newDir & DIRECTION_MASK; - entity->direction = newDir & DIRECTION_MASK; + entity->axObj.info->action.direction = newDir & DIRECTION_MASK; + entity->axObj.unk44_direction1 = newDir & DIRECTION_MASK; } } } @@ -151,20 +158,20 @@ void sub_806CE34(Entity *entity, u32 newDir) void sub_806CE68(Entity *entity, u32 newDir) { if (GetEntityType(entity) == ENTITY_MONSTER) { - entity->unk6A = sub_806CEBC(entity); + entity->axObj.unk42_animId1 = sub_806CEBC(entity); if (newDir < NUM_DIRECTIONS) - entity->direction = newDir; + entity->axObj.unk44_direction1 = newDir; } } void sub_806CE94(Entity *entity, u32 newDir) { if (GetEntityType(entity) == ENTITY_MONSTER) { - entity->unk6A = 6; + entity->axObj.unk42_animId1 = 6; if (newDir < NUM_DIRECTIONS) - entity->direction = newDir; + entity->axObj.unk44_direction1 = newDir; } } @@ -189,7 +196,7 @@ u8 sub_806CEBC(Entity *entity) void sub_806CEFC(Entity *entity, u32 newDir) { - entity->info->action.direction = newDir & DIRECTION_MASK; + entity->axObj.info->action.direction = newDir & DIRECTION_MASK; sub_806CE68(entity, newDir & DIRECTION_MASK); } @@ -201,18 +208,18 @@ void sub_806CF18(Entity *entity) if (!EntityExists(entity)) return; - entityInfo = entity->info; + entityInfo = entity->axObj.info; for (i = 0; i < 100; i++) { sub_803E46C(33); - if (!sub_808DA44(entityInfo->apparentID, entity->unk6B)) + if (!sub_808DA44(entityInfo->apparentID, entity->axObj.unk43_animId2)) break; } } u8 sub_806CF54(Entity *entity) { - return entity->info->unk204; + return entity->axObj.info->unk204; } void sub_806CF60(void) @@ -237,7 +244,7 @@ u32 sub_806CF98(Entity *entity) mapTile = GetTileAtEntitySafe(entity); terrainType = mapTile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); - entityInfo = entity->info; + entityInfo = entity->axObj.info; shadowSize = GetShadowSize(entityInfo->apparentID); if (terrainType == (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) @@ -339,19 +346,19 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * return; r9 = arg8; - if (CheckVariousStatuses(target) || target->info->charging.chargingStatus != 0) + if (CheckVariousStatuses(target) || target->axObj.info->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->info->protection.protectionStatus == STATUS_VITAL_THROW) + && target->axObj.info->protection.protectionStatus == STATUS_VITAL_THROW) { sub_8042730(target, attacker); sub_807F43C(target, attacker); } - if (target->info->charging.chargingStatus == STATUS_ENRAGED) { + if (target->axObj.info->charging.chargingStatus == STATUS_ENRAGED) { RaiseAttackStageTarget(attacker, target, gUnknown_8106A4C, 1); } @@ -363,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->info->protection.protectionStatus == STATUS_COUNTER && isPhysical) { + if (target->axObj.info->protection.protectionStatus == STATUS_COUNTER && isPhysical) { sub_8041B18(target); returnDmg += 4; } - if (target->info->protection.protectionStatus == STATUS_MINI_COUNTER && isPhysical) { + if (target->axObj.info->protection.protectionStatus == STATUS_MINI_COUNTER && isPhysical) { sub_8041B18(target); returnDmg += 1; } - if (target->info->protection.protectionStatus == STATUS_MIRROR_COAT && !isPhysical) { + if (target->axObj.info->protection.protectionStatus == STATUS_MIRROR_COAT && !isPhysical) { sub_8041B90(target); returnDmg += 4; } @@ -402,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->info; + EntityInfo *attackerInfo = attacker->axObj.info; if (HasAbility(target, ABILITY_ARENA_TRAP) && !MonsterIsType(attacker, TYPE_FLYING) @@ -474,7 +481,7 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * if (destBondTarget == NULL) { targetInfo->linked.linkedStatus = 0; } - else if (destBondTarget->info->unk98 != targetInfo->linked.unkD4) { + else if (destBondTarget->axObj.info->unk98 != targetInfo->linked.unkD4) { targetInfo->linked.linkedStatus = 0; } else { @@ -510,7 +517,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc TrySendImmobilizeSleepEndMsg(attacker, target); SetShopkeeperAggression(attacker, target); if (GetEntityType(attacker) == ENTITY_MONSTER - && attacker->info->moveStatus.moveStatus == STATUS_SET_DAMAGE + && attacker->axObj.info->moveStatus.moveStatus == STATUS_SET_DAMAGE && dmgStruct->unkE == 0) { dmgStruct->dmg = gUnknown_80F4F8C; @@ -644,7 +651,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } TargetTileInFront(target); } - sub_806CDD4(target, 6, target->info->action.direction); + sub_806CDD4(target, 6, target->axObj.info->action.direction); sub_80420E8(target, dmgStruct); var_24 = TRUE; } @@ -961,7 +968,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } } - if (EntityExists(attacker) && GetEntityType(attacker) == ENTITY_MONSTER && !attacker->info->isTeamLeader) + if (EntityExists(attacker) && GetEntityType(attacker) == ENTITY_MONSTER && !attacker->axObj.info->isTeamLeader) r10 = FALSE; if (r10) { diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index becd63472..2a97ff574 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -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->info; + entityInfo = pokemon->axObj.info; 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->info; + entityInfo_1 = pokemon->axObj.info; 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->info->isNotTeamMember) + if(pokemon->axObj.info->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->info; + entityInfo = target->axObj.info; hasNegStatus_target = HasNegativeStatus(target); visFlags_target = SetVisualFlags(entityInfo, 8, hasNegStatus_target); if (hasNegStatus_target) { diff --git a/src/code_806FDF4.c b/src/code_806FDF4.c index d100ad0ac..0fe9a2694 100644 --- a/src/code_806FDF4.c +++ b/src/code_806FDF4.c @@ -64,7 +64,7 @@ void SetShopkeeperAggression(Entity *pokemon, Entity *target) { if(GetEntityType(pokemon) == ENTITY_MONSTER) { - if(pokemon->info->isNotTeamMember) + if(pokemon->axObj.info->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->info; + EntityInfo *info = pokemon->axObj.info; 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->info->apparentID); - entity->unk68 = sVar6; - entity->info->unk167 = index; - entity->info->unk168 = size; + size = GetBodySize(entity->axObj.info->apparentID); + entity->axObj.unk40_maybeAnimTimer = sVar6; + entity->axObj.info->unk167 = index; + entity->axObj.info->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->info; + info = param_1->axObj.info; iVar4 = -1; size = GetBodySize((int)info->apparentID); if (sub_806F9BC((int)info->id) != 0) { diff --git a/src/code_80718D8.c b/src/code_80718D8.c index dd5f0f765..a45795fc7 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -175,7 +175,7 @@ void sub_8071D4C(Entity *pokemon, Entity *target, s32 exp) s32 expDiff; EntityInfo *info; - info = target->info; + info = target->axObj.info; 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->info; + info = target->axObj.info; if (info->isTeamLeader) { GetAvailTacticsforLvl_Bool(tacticsBuffer1,info->level); } @@ -573,7 +573,7 @@ void sub_807218C(Entity *pokemon) s32 r3; r6 = 0; - info = pokemon->info; + info = pokemon->axObj.info; 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->info; + info = target->axObj.info; 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->info; + info = target->axObj.info; id = info->id; exp = info->exp; @@ -785,7 +785,7 @@ bool8 sub_80725A4(Entity *pokemon, Entity *target) if(!EntityExists(target)) return FALSE; - info = target->info; + info = target->axObj.info; id = info->id; exp = info->exp; oldLevel = info->level; diff --git a/src/code_8072B78.c b/src/code_8072B78.c index b130e80f7..2fbacaa5b 100644 --- a/src/code_8072B78.c +++ b/src/code_8072B78.c @@ -110,14 +110,14 @@ void sub_8072B78(Entity *pokemon, Entity *target, s16 id) struct unkStruct_806B7F8 local_2c; id_s32 = id; - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument_2(gAvailablePokemonNames,entityInfo,0); CopyCyanMonsterNametoBuffer(gAvailablePokemonNames + 0x50,id_s32); file = GetSpriteData(id_s32); fu(entityInfo, id_s32); GetPokemonLevelData(&levelData,id_s32,entityInfo->level); entityInfo->exp = levelData.expRequired; - target->sprite = file; + target->axObj.spriteFile = file; sub_806BFC0(entityInfo,0); sub_8069E0C(target); sub_806CCB4(target,7); diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index cab0f537f..a32ce4c99 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -135,7 +135,7 @@ void sub_8073D14(Entity *entity) { Item *groundItem; EntityInfo *_entityInfo; - EntityInfo *entityInfo = entity->info; + EntityInfo *entityInfo = entity->axObj.info; Entity *tileObject = GetTileAtEntitySafe(entity)->object; if (tileObject == NULL) return; @@ -151,7 +151,7 @@ void sub_8073D14(Entity *entity) if (entityInfo->clientType == 1) return; - _entityInfo = entity->info; // Reloaded as a new variable for some reason. + _entityInfo = entity->axObj.info; // 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->info; + entityInfo = entity->axObj.info; 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->info; + EntityInfo *targetInfo = target->axObj.info; if (targetInfo->unk98 != entityInfo->linked.unkD4) { entityInfo->linked.linkedStatus = 0; } @@ -635,7 +635,7 @@ void TickStatusHeal(Entity *entity) return; sub_805229C(); - entityInfo = entity->info; + entityInfo = entity->axObj.info; // 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->info->speedStage; + s32 oldSpdStage = entity->axObj.info->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->info; + EntityInfo *entityInfo = entity->axObj.info; 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->info->isTeamLeader = mon->info->isTeamLeader; + mon->axObj.info->isTeamLeader = mon->axObj.info->isTeamLeader; if (monInfo->flags & 0x2000) { monInfo->flags &= ~(0x2000); diff --git a/src/code_8075708.c b/src/code_8075708.c index 654bba5af..18aab0c46 100644 --- a/src/code_8075708.c +++ b/src/code_8075708.c @@ -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->info, !info->isTeamLeader)) { + if ((EntityExists(entity)) && (info = entity->axObj.info, !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->info; + info = entity->axObj.info; 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->info; + entityInfo = entity->axObj.info; if(EntityExists(entity)) { tile = GetTileAtEntitySafe(entity); diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index f1d24c608..c02b73fa7 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -217,7 +217,7 @@ void MuzzleTarget(Entity *pokemon, Entity *target) EntityInfo *entityInfo; if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { - entityInfo = target->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF04); @@ -276,7 +276,7 @@ void TransformStatusTarget(Entity * pokemon, Entity * target) TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBEE4); else { entityInfo->apparentID = apparentID; - target->sprite = sprite; + target->axObj.spriteFile = sprite; entityInfo->transformStatus.transformStatus = STATUS_TRANSFORMED; entityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EFC, TRUE) + 1; sub_806CF98(target); @@ -297,7 +297,7 @@ void MobileStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { - entityInfo_1 = target->info; + entityInfo_1 = target->axObj.info; entityInfo = entityInfo_1; if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) { @@ -331,7 +331,7 @@ void ExposeStatusTarget(Entity * pokemon, Entity * target, s16 param_3) flag2 = FALSE; if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->hitChanceStages[1] > 10) { entityInfo->hitChanceStages[1] = 10; @@ -368,7 +368,7 @@ void IdentityItemHolders(Entity *pokemon, Entity *target) EntityInfo *entityInfo; if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { - entityInfo = target->info; + entityInfo = target->axObj.info; if (!gDungeon->itemHoldersIdentified) { nullsub_89(target); gDungeon->itemHoldersIdentified = TRUE; @@ -387,7 +387,7 @@ void BlindTarget(Entity *pokemon, Entity *target) EntityInfo *entityInfo; if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->eyesightStatus.eyesightStatus != STATUS_BLINKER) { entityInfo->eyesightStatus.eyesightStatus = STATUS_BLINKER; @@ -414,7 +414,7 @@ void CrossEyeVisionTarget(Entity *pokemon, Entity *target) if (EntityExists(target)) { if(!HasSafeguardStatus(pokemon, target, TRUE)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->eyesightStatus.eyesightStatus != STATUS_CROSS_EYED) { sub_8041E1C(target); @@ -440,7 +440,7 @@ void RestoreVisionTarget(Entity *pokemon, Entity *target) if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->eyesightStatus.eyesightStatus != STATUS_EYEDROPS) { entityInfo->eyesightStatus.eyesightStatus = STATUS_EYEDROPS; @@ -471,7 +471,7 @@ void RestorePPTarget(Entity * pokemon,Entity * target, s32 param_3) PPChanged = FALSE; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; for(index = 0; index < MAX_MON_MOVES; index++) { @@ -625,7 +625,7 @@ void LongTossStatusTarget(Entity * pokemon, Entity * target) { EntityInfo *entityInfo; - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gUnknown_202DFE8,target,0); if (entityInfo->itemStatus.itemStatus != STATUS_LONG_TOSS) { entityInfo->itemStatus.itemStatus = STATUS_LONG_TOSS; @@ -642,7 +642,7 @@ void PierceStatusTarget(Entity * pokemon, Entity * target) { EntityInfo *entityInfo; - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gUnknown_202DFE8,target,0); if (entityInfo->itemStatus.itemStatus != STATUS_PIERCE) { entityInfo->itemStatus.itemStatus = STATUS_PIERCE; @@ -666,7 +666,7 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if ((entityInfo->charging.chargingStatus == newStatus) && (newStatus == STATUS_ENRAGED)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC074); @@ -726,7 +726,7 @@ void sub_8079764(Entity * pokemon) EntityInfo *entityInfo; if (EntityExists(pokemon)) { - entityInfo = pokemon->info; + entityInfo = pokemon->axObj.info; if ((entityInfo->charging.chargingStatus != STATUS_BIDE) && (entityInfo->charging.chargingStatus != STATUS_ENRAGED)) { entityInfo->charging.chargingStatus = STATUS_NONE; entityInfo->unk14A = 0; @@ -741,7 +741,7 @@ void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->protection.protectionStatus == newStatus) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB10C); @@ -763,7 +763,7 @@ void SafeguardStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->protection.protectionStatus != STATUS_SAFEGUARD) { entityInfo->protection.protectionStatus = STATUS_SAFEGUARD; @@ -783,7 +783,7 @@ void MistStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->protection.protectionStatus != STATUS_MIST) { entityInfo->protection.protectionStatus = STATUS_MIST; @@ -803,7 +803,7 @@ void WishStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->protection.protectionStatus != STATUS_WISH) { entityInfo->protection.protectionStatus = STATUS_WISH; @@ -823,7 +823,7 @@ void MagicCoatStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->protection.protectionStatus != STATUS_MAGIC_COAT) { entityInfo->protection.protectionStatus = STATUS_MAGIC_COAT; @@ -843,7 +843,7 @@ void LightScreenStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->protection.protectionStatus != STATUS_LIGHT_SCREEN) { entityInfo->protection.protectionStatus = STATUS_LIGHT_SCREEN; @@ -863,7 +863,7 @@ void ReflectStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->protection.protectionStatus != STATUS_REFLECT) { entityInfo->protection.protectionStatus = STATUS_REFLECT; @@ -884,7 +884,7 @@ void ProtectStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { nullsub_63(target); - entityInfo = target->info; + entityInfo = target->axObj.info; if (entityInfo->protection.protectionStatus != STATUS_PROTECT) { entityInfo->protection.protectionStatus = STATUS_PROTECT; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4ED4, FALSE) + 1; @@ -904,7 +904,7 @@ void MirrorCoatStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->protection.protectionStatus != STATUS_MIRROR_COAT) { entityInfo->protection.protectionStatus = STATUS_MIRROR_COAT; @@ -924,7 +924,7 @@ void EndureStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->protection.protectionStatus != STATUS_ENDURING) { entityInfo->protection.protectionStatus = STATUS_ENDURING; @@ -944,7 +944,7 @@ void MirrorMoveStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->protection.protectionStatus != STATUS_MIRROR_MOVE) { entityInfo->protection.protectionStatus = STATUS_MIRROR_MOVE; @@ -964,7 +964,7 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; if(HasAbility(target, ABILITY_FORECAST)) TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsConversion2Message); @@ -990,7 +990,7 @@ void VitalThrowStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->protection.protectionStatus != STATUS_VITAL_THROW) { entityInfo->protection.protectionStatus = STATUS_VITAL_THROW; @@ -1013,7 +1013,7 @@ void sub_8079E34(Entity * pokemon, Entity * target, bool8 param_3) statChanged = FALSE; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; for(index = 0; index < 2; index++) { @@ -1067,7 +1067,7 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4) bVar8 = FALSE; moveUnsealed = FALSE; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; if (HasNegativeStatus(target)) { bVar8 = TRUE; SendSleepEndMessage(pokemon,target,0,0); @@ -1135,7 +1135,7 @@ void sub_807A0CC(Entity * pokemon, Entity * target) s32 index; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; sub_806BFC0(entityInfo,0); entityInfo->perishSongTurns = 0; entityInfo->exposed = FALSE; @@ -1160,7 +1160,7 @@ void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 if (!EntityExists(target)) { return; } - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); switch(entityInfo->sleep.sleep) { case STATUS_NONE: @@ -1210,7 +1210,7 @@ void SendNonVolatileEndMessage(Entity * pokemon, Entity * target) if (!EntityExists(target)) { return; } - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); switch(entityInfo->nonVolatile.nonVolatileStatus) { case STATUS_NONE: @@ -1241,7 +1241,7 @@ void SendImmobilizeEndMessage(Entity * pokemon, Entity *target) if (!EntityExists(target)) { return; } - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); switch(entityInfo->immobilize.immobilizeStatus) { case STATUS_NONE: @@ -1281,7 +1281,7 @@ void SendVolatileEndMessage(Entity * pokemon, Entity *target) if (!EntityExists(target)) { return; } - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); switch(entityInfo->volatileStatus.volatileStatus) { case STATUS_NONE: @@ -1321,7 +1321,7 @@ void SendProtectionEndMessage(Entity * pokemon, Entity *target) if (!EntityExists(target)) { return; } - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); switch(entityInfo->protection.protectionStatus) { case STATUS_NONE: @@ -1378,7 +1378,7 @@ void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); switch(entityInfo->waitingStruct.waitingStatus) { case STATUS_NONE: @@ -1417,7 +1417,7 @@ void SendLinkedEndMessage(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); switch(entityInfo->linked.linkedStatus) { @@ -1443,7 +1443,7 @@ void SendMoveEndMessage(Entity * pokemon, Entity * target) if (!EntityExists(target)) { return; } - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); switch(entityInfo->moveStatus.moveStatus) { case STATUS_NONE: @@ -1476,7 +1476,7 @@ void SendTransformEndMessage(Entity * pokemon, Entity *target) if (!EntityExists(target)) { return; } - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); switch(entityInfo->transformStatus.transformStatus) { case STATUS_NONE: @@ -1491,7 +1491,7 @@ void SendTransformEndMessage(Entity * pokemon, Entity *target) break; case STATUS_TRANSFORMED: entityInfo->apparentID = sub_8069F54(target, entityInfo->id); - target->sprite = GetSpriteData(entityInfo->apparentID); + target->axObj.spriteFile = GetSpriteData(entityInfo->apparentID); uVar3 = sub_806CEBC(target); sub_806CCB4(target,uVar3); TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAB6C); @@ -1511,7 +1511,7 @@ void SendEyesightEndMessage(Entity * pokemon,Entity * target) if (!EntityExists(target)) { return; } - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); switch(entityInfo->eyesightStatus.eyesightStatus) { case STATUS_NONE: @@ -1543,7 +1543,7 @@ void SendMuzzledEndMessage(Entity * pokemon, Entity * target) if (!EntityExists(target)) { return; } - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); switch(entityInfo->muzzled.muzzled) { case FALSE: @@ -1577,7 +1577,7 @@ void WakeUpPokemon(Entity * pokemon) { EntityInfo *entityInfo; - entityInfo = pokemon->info; + entityInfo = pokemon->axObj.info; entityInfo->sleep.sleep = STATUS_NONE; entityInfo->sleep.sleepTurns = 0; sub_806A898(pokemon, 1, 1); @@ -1589,7 +1589,7 @@ void SendThawedMessage(Entity *pokemon, Entity *target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; if (entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) { entityInfo->immobilize.immobilizeStatus = STATUS_NONE; entityInfo->immobilize.immobilizeStatusTurns = 0; @@ -1618,7 +1618,7 @@ void sub_807AA30(void) { wildEntity = gDungeon->wildPokemon[wildIndex]; if (EntityExists(wildEntity) && - (entityInfo = wildEntity->info, entityInfo->sleep.sleep == STATUS_SLEEP) && + (entityInfo = wildEntity->axObj.info, entityInfo->sleep.sleep == STATUS_SLEEP) && (entityInfo->sleep.sleepTurns == 0x7F)) { adjacentCheck = FALSE; forceWakeup = FALSE; diff --git a/src/code_807CD9C.c b/src/code_807CD9C.c index e2eacb392..ef343512e 100644 --- a/src/code_807CD9C.c +++ b/src/code_807CD9C.c @@ -82,7 +82,7 @@ void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction) } else { - (target->info->action).direction = (direction + 4) & DIRECTION_MASK; + (target->axObj.info->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->info->isTeamLeader) { + if (target->axObj.info->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->info; + info = target->axObj.info; flag = FALSE; SetMessageArgument(gAvailablePokemonNames,target,0); diff --git a/src/code_807E1A0.c b/src/code_807E1A0.c index a2582b05e..7141ed9bd 100644 --- a/src/code_807E1A0.c +++ b/src/code_807E1A0.c @@ -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->info; + targetInfo = target->axObj.info; 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->info->isTeamLeader) { + if (pokemon->axObj.info->isTeamLeader) { sub_804AC20(&pokemon->pos); sub_807EC28(FALSE); } @@ -106,7 +106,7 @@ void sub_807E254(Entity *pokemon,Entity *target) } if (EntityExists(target)) { - if (target->info->isTeamLeader) { + if (target->axObj.info->isTeamLeader) { sub_804AC20(&target->pos); sub_807EC28(FALSE); } diff --git a/src/code_8083288.c b/src/code_8083288.c index a96740a08..0693099ce 100644 --- a/src/code_8083288.c +++ b/src/code_8083288.c @@ -31,8 +31,8 @@ void sub_8082B40(void) { entity = gDungeon->allPokemon[index]; if (EntityExists(entity)) { - info = entity->info; - entity->sprite = GetSpriteData(info->apparentID); + info = entity->axObj.info; + entity->axObj.spriteFile = GetSpriteData(info->apparentID); sub_806CCB4(entity,sub_806CEBC(entity)); pos = entity->pos; AddPokemonDungeonSprite(info->unk98,info->apparentID,&pos,3); diff --git a/src/code_8085E98.c b/src/code_8085E98.c index 68b642a1e..585689571 100644 --- a/src/code_8085E98.c +++ b/src/code_8085E98.c @@ -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->info, ((info->heldItem).flags & 1))) && ((info->heldItem).id == id)) return TRUE; + if (((EntityExists(entity)) && (info = entity->axObj.info, ((info->heldItem).flags & 1))) && ((info->heldItem).id == id)) return TRUE; } return FALSE; } diff --git a/src/code_80861A8.c b/src/code_80861A8.c index 703b0e647..21f4ea415 100644 --- a/src/code_80861A8.c +++ b/src/code_80861A8.c @@ -27,7 +27,7 @@ void sub_8052FB8(const u8 *); void sub_8086124(Entity *entity, u8 param_2) { - entity->info->unk160 = param_2; + entity->axObj.info->unk160 = param_2; } void sub_8086130(void) @@ -55,7 +55,7 @@ void sub_80861B8(Entity *a0, u8 r1, s32 direction) { EntityInfo *info; - info = a0->info; + info = a0->axObj.info; 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->info->unkFE = 0x63; + a0->axObj.info->unkFE = 0x63; } s32 sub_80861F8(s16 param_1,Entity *param_2,bool32 param_3) @@ -91,12 +91,13 @@ s32 sub_80861F8(s16 param_1,Entity *param_2,bool32 param_3) sub_800EE5C(param_1); sub_800EF64(); sub_803E46C(0x46); - info = param_2->info; + info = param_2->axObj.info; pos.x = 0; pos.y = 0; uStack_38 = sub_800E700(param_1_s32); if (uStack_38 != -1) { - sub_800569C(&pos,¶m_2->spriteInfo,uStack_38); + sub_800569C(&pos,&(*(struct EntitySpriteInfo *)¶m_2->axObj.axdata), + uStack_38); } stack.unk0 = param_1_s32; stack.unk4 = 0; diff --git a/src/code_80869E4.c b/src/code_80869E4.c index e2576aafd..e144b232a 100644 --- a/src/code_80869E4.c +++ b/src/code_80869E4.c @@ -425,14 +425,14 @@ void sub_8086854(void) void sub_80868F4(Entity *entity) { - entity->info->unk15C = 1; - entity->info->unk15D = 1; + entity->axObj.info->unk15C = 1; + entity->axObj.info->unk15D = 1; } void sub_8086910(Entity *entity) { - entity->info->unk15C = 0; - entity->info->unk15D = 0; + entity->axObj.info->unk15C = 0; + entity->axObj.info->unk15D = 0; } void sub_808692C(void) @@ -455,7 +455,7 @@ void SpriteLookAroundEffect(Entity *entity) s8 r4; s8 r3; - r4 = sub_8002984(entity->info->action.direction, 4); + r4 = sub_8002984(entity->axObj.info->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->info; + info = a0->axObj.info; r4 = (s8)info->action.direction; while (r4 != tmp) { r4 = sub_8002A70(r4, tmp, a2); diff --git a/src/dungeon_action.c b/src/dungeon_action.c index 65a6a84b3..df84cde55 100644 --- a/src/dungeon_action.c +++ b/src/dungeon_action.c @@ -53,7 +53,7 @@ void sub_8044820(void) entity = gDungeon->wildPokemon[index]; if (EntityExists(entity)) { if (sub_8044B28()) break; - entityInfo = entity->info; + entityInfo = entity->axObj.info; 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->info, entityInfo2->aiNextToTarget)) + if ((EntityExists(entity2)) && (entityInfo2 = entity2->axObj.info, entityInfo2->aiNextToTarget)) { sub_8074094(entity2); if (EntityExists(entity2)) { @@ -121,7 +121,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void) { entity = gDungeon->allPokemon[index]; if (EntityExists(entity)) { - entityInfo = entity->info; + entityInfo = entity->axObj.info; entityInfo2 = entityInfo; entityInfo->attacking = FALSE; diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index 62c064869..41b62801b 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -48,7 +48,7 @@ void sub_8075900(Entity *pokemon, u8 r1) { if(EntityExists(pokemon)) { - if(!pokemon->info->isNotTeamMember) + if(!pokemon->axObj.info->isNotTeamMember) { if(!sub_8044B28()) { @@ -72,7 +72,7 @@ void sub_8075900(Entity *pokemon, u8 r1) void RunMonsterAI(Entity *pokemon, u32 unused) { - EntityInfo *pokemonInfo = pokemon->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info->waitingStruct.waitingStatus == STATUS_DECOY && + target->axObj.info->waitingStruct.waitingStatus == STATUS_DECOY && CanSeeTarget(pokemon, target)) { - bool8 enemyDecoy = target->info->waitingStruct.enemyDecoy; + bool8 enemyDecoy = target->axObj.info->waitingStruct.enemyDecoy; u8 targetingDecoy = TARGETING_DECOY_TEAM; if (enemyDecoy) { diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c index a6b32d018..9877013a2 100644 --- a/src/dungeon_ai_attack.c +++ b/src/dungeon_ai_attack.c @@ -70,7 +70,7 @@ extern void sub_806A5B8(struct Entity *entity); void DecideAttack(Entity *pokemon) { - EntityInfo *pokemonInfo = pokemon->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info; + EntityInfo *userData = user->axObj.info; 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->info; + targetData = target->axObj.info; goto checkThirdParty; } else if (categoryTargetingFlags == TARGETING_FLAG_ATTACK_ALL) { - targetData = target->info; + targetData = target->axObj.info; 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->info; + targetData = target->axObj.info; 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->info; + targetData2 = targetData = target->axObj.info; 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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info->immobilize.immobilizeStatus != STATUS_FROZEN)) + (!hasStatusChecker || target->axObj.info->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->info; + entityInfo = target->axObj.info; 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->info->action.unk4[0].actionUseIndex); + sub_806A9B4(target, target->axObj.info->action.unk4[0].actionUseIndex); sub_806A1B0(target); } @@ -989,7 +989,7 @@ void HandleUseOrbAction(Entity *pokemon) struct AIPossibleMove sp28; bool8 r8; - entityInfo = pokemon->info; + entityInfo = pokemon->axObj.info; item = sub_8044D90(pokemon, 0, 21); IVar5 = *item; diff --git a/src/dungeon_ai_item_weight.c b/src/dungeon_ai_item_weight.c index 4a8a0af5e..0bb843ce4 100644 --- a/src/dungeon_ai_item_weight.c +++ b/src/dungeon_ai_item_weight.c @@ -13,7 +13,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFlags) { - EntityInfo *pokemonInfo = targetPokemon->info; + EntityInfo *pokemonInfo = targetPokemon->axObj.info; 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->info->speedStage < MAX_SPEED_STAGE) + if (targetPokemon->axObj.info->speedStage < MAX_SPEED_STAGE) { if (IsAdjacentToEnemy(targetPokemon)) { diff --git a/src/dungeon_ai_items.c b/src/dungeon_ai_items.c index c87ec3a24..725898c6f 100644 --- a/src/dungeon_ai_items.c +++ b/src/dungeon_ai_items.c @@ -52,9 +52,9 @@ void sub_807360C(void) entity = gDungeon->allPokemon[index]; if(EntityExists(entity)) { - if(entity->info->unk152 != 0) + if(entity->axObj.info->unk152 != 0) { - entity->info->unk152 = 0; + entity->axObj.info->unk152 = 0; UpdateFlashFireBoost(entity, entity); } } @@ -63,7 +63,7 @@ void sub_807360C(void) void AIDecideUseItem(Entity *pokemon) { - EntityInfo *pokemonInfo = pokemon->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info->itemStatus.itemStatus == STATUS_NONE) + if (pokemon->axObj.info->itemStatus.itemStatus == STATUS_NONE) { s32 distance = distanceY < distanceX ? distanceX : distanceY; if (distance > RANGED_ATTACK_RANGE) diff --git a/src/dungeon_ai_leader.c b/src/dungeon_ai_leader.c index 08294a096..bf1eddccd 100644 --- a/src/dungeon_ai_leader.c +++ b/src/dungeon_ai_leader.c @@ -84,20 +84,20 @@ u32 sub_8075818(Entity *entity); bool8 TargetLeader(Entity *pokemon) { - if (pokemon->info->isNotTeamMember) + if (pokemon->axObj.info->isNotTeamMember) { return FALSE; } - return TacticsTargetLeader(pokemon->info->tactic); + return TacticsTargetLeader(pokemon->axObj.info->tactic); } Entity* GetLeaderIfVisible(Entity *pokemon) { - if (!pokemon->info->isNotTeamMember) + if (!pokemon->axObj.info->isNotTeamMember) { Entity *leader = GetLeader(); if (leader && - leader->info->waitingStruct.waitingStatus != STATUS_DECOY && + leader->axObj.info->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->info; + info = entity->axObj.info; 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->info->unk14A == 0) { - entity->info->unk14A = 0; + if (entity->axObj.info->unk14A == 0) { + entity->axObj.info->unk14A = 0; sub_8079764(entity); } sub_8041888(0); diff --git a/src/dungeon_ai_movement.c b/src/dungeon_ai_movement.c index ec5a10621..614f31a0f 100644 --- a/src/dungeon_ai_movement.c +++ b/src/dungeon_ai_movement.c @@ -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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info->clientType == CLIENT_TYPE_NONE) + if (EntityExists(target) && target->axObj.info->clientType == CLIENT_TYPE_NONE) { if (gDungeon->decoyActive) { @@ -178,11 +178,11 @@ bool8 ChooseTargetPosition(Entity *pokemon) continue; } } - else if (!pokemonInfo->isNotTeamMember && target->info->immobilize.immobilizeStatus == STATUS_PETRIFIED) + else if (!pokemonInfo->isNotTeamMember && target->axObj.info->immobilize.immobilizeStatus == STATUS_PETRIFIED) { continue; } - if (target->info->shopkeeper != SHOPKEEPER_MODE_SHOPKEEPER) + if (target->axObj.info->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->info; + EntityInfo *targetData = pokemonInfo->aiTarget.aiTarget->axObj.info; 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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; u8 room = GetEntityRoom(pokemon); Entity **possibleTargets; s32 numPossibleTargets; @@ -701,7 +701,7 @@ bool8 AvoidEnemies(Entity *pokemon) bool8 Wander(Entity *pokemon) { - EntityInfo *pokemonInfo = pokemon->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; s32 room = GetEntityRoom(pokemon); s32 targetFacingDir = 0; if (room == CORRIDOR_ROOM) @@ -808,7 +808,7 @@ void sub_807BB78(Entity *pokemon) { EntityInfo *entityInfo; - entityInfo = pokemon->info; + entityInfo = pokemon->axObj.info; entityInfo->aiTarget.aiObjective = 0; entityInfo->aiTarget.aiTargetPos = pokemon->pos; entityInfo->aiTarget.aiTarget = 0; diff --git a/src/dungeon_ai_targeting.c b/src/dungeon_ai_targeting.c index 1cb525f57..19f21f03f 100644 --- a/src/dungeon_ai_targeting.c +++ b/src/dungeon_ai_targeting.c @@ -67,14 +67,14 @@ bool8 sub_8070F3C(Entity * pokemon, Position *pos, s32 direction) u8 terrain; struct Tile *tile; - terrain = GetCrossableTerrain(pokemon->info->id); + terrain = GetCrossableTerrain(pokemon->axObj.info->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->info->transformStatus.transformStatus == STATUS_MOBILE || + if (pokemon->axObj.info->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->info->id); + terrain = GetCrossableTerrain(pokemon->axObj.info->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->info->transformStatus.transformStatus == STATUS_MOBILE || + if (pokemon->axObj.info->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->info->id); + terrain = GetCrossableTerrain(pokemon->axObj.info->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->info->isNotTeamMember)))) { + (!tile->monster->axObj.info->isNotTeamMember)))) { if (!IsCurrentFixedRoomBossFight()) { - if (pokemon->info->transformStatus.transformStatus == STATUS_MOBILE || + if (pokemon->axObj.info->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->info->id); + u8 crossableTerrain = GetCrossableTerrain(pokemon->axObj.info->id); struct Tile *tile; if (crossableTerrain < CROSSABLE_TERRAIN_CREVICE) { @@ -230,7 +230,7 @@ bool8 CanAttackInDirection(Entity *pokemon, s32 direction) { if (!IsCurrentFixedRoomBossFight()) { - if (pokemon->info->transformStatus.transformStatus == STATUS_MOBILE || + if (pokemon->axObj.info->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->info->id); + u8 crossableTerrain = GetCrossableTerrain(pokemon->axObj.info->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->info->eyesightStatus.eyesightStatus == STATUS_EYEDROPS)) + (frontTile->object->isVisible || pokemon->axObj.info->eyesightStatus.eyesightStatus == STATUS_EYEDROPS)) { return FALSE; } @@ -294,7 +294,7 @@ bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemon } if (!IsCurrentFixedRoomBossFight()) { - if (pokemon->info->transformStatus.transformStatus == STATUS_MOBILE || + if (pokemon->axObj.info->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->info->id); + u32 crossableTerrain = GetCrossableTerrain(pokemon->axObj.info->id); if (!IsCurrentFixedRoomBossFight()) { - if (pokemon->info->transformStatus.transformStatus == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + if (pokemon->axObj.info->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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; pokemonInfo->mobileTurnTimer += DungeonRandInt(100); if (pokemonInfo->mobileTurnTimer < 200) { @@ -409,7 +409,7 @@ bool8 ShouldMonsterRunAway(Entity *pokemon) } else { - EntityInfo *pokemonInfo = pokemon->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; if (pokemonInfo->terrifiedTurns != 0) { return TRUE; @@ -450,7 +450,7 @@ void CheckRunAwayVisualFlag(Entity *pokemon, bool8 showRunAwayEffect) bool8 cVar1; EntityInfo *iVar2; EntityInfo *iVar3; - iVar2 = pokemon->info; + iVar2 = pokemon->axObj.info; iVar3 = iVar2; if (((!iVar2->isTeamLeader) && HasAbility(pokemon,ABILITY_RUN_AWAY) && @@ -462,8 +462,8 @@ void CheckRunAwayVisualFlag(Entity *pokemon, bool8 showRunAwayEffect) u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ignoreInvisible, bool8 checkPetrified) { - EntityInfo *pokemonInfo = pokemon->info; - EntityInfo *targetData = targetPokemon->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; + EntityInfo *targetData = targetPokemon->axObj.info; u8 targetingDecoy; u8 pokemonTargetingDecoy; bool8 pokemonIsEnemy; @@ -532,8 +532,8 @@ u8 sub_807167C(Entity * pokemon, Entity * target) EntityInfo * targetEntityInfo; EntityInfo * pokemonEntityData; - pokemonEntityData = pokemon->info; - targetEntityInfo = target->info; + pokemonEntityData = pokemon->axObj.info; + targetEntityInfo = target->axObj.info; if (pokemonEntityData->clientType != CLIENT_TYPE_CLIENT) { cannotUseItems = IsClientOrTeamBase(pokemonEntityData->joinedAt.joinedAt); if (!cannotUseItems && (pokemonEntityData->shopkeeper == SHOPKEEPER_MODE_NORMAL) && (targetEntityInfo->clientType != CLIENT_TYPE_CLIENT)) { diff --git a/src/dungeon_capabilities.c b/src/dungeon_capabilities.c index b015ea4b8..a9761fb57 100644 --- a/src/dungeon_capabilities.c +++ b/src/dungeon_capabilities.c @@ -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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info; + EntityInfo *entityInfo = entity->axObj.info; 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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info->id); + u8 crossableTerrain = GetCrossableTerrain(pokemon->axObj.info->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->info->transformStatus.transformStatus == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + if (pokemon->axObj.info->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; diff --git a/src/dungeon_cutscenes.c b/src/dungeon_cutscenes.c index 4fa360585..6b21e609d 100644 --- a/src/dungeon_cutscenes.c +++ b/src/dungeon_cutscenes.c @@ -462,14 +462,14 @@ void SkarmoryEntry(Entity *); void sub_8086A3C(Entity *pokemon) { - pokemon->info->unk15C = 1; - pokemon->info->unk15E = 1; + pokemon->axObj.info->unk15C = 1; + pokemon->axObj.info->unk15E = 1; } void sub_8086A54(Entity *pokemon) { - pokemon->info->unk15C = 1; - pokemon->info->unk15E = 0; + pokemon->axObj.info->unk15C = 1; + pokemon->axObj.info->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->info->unk15C = 1; + diglettEntity->axObj.info->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->info->unk15D = 1; + diglettEntity->axObj.info->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->info->clientType != param_1)) { + if ((EntityExists(entity)) && (entity->axObj.info->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->info->unk15F = 1; - iVar3->info->unk15F = 1; - iVar4->info->unk15F = 1; + iVar2->axObj.info->unk15F = 1; + iVar3->axObj.info->unk15F = 1; + iVar4->axObj.info->unk15F = 1; while( TRUE ) { if (!sub_8085B80(auStack_4c)) break; sub_803E46C(0x46); } - iVar2->info->unk15F = 0; - iVar3->info->unk15F = 0; - iVar4->info->unk15F = 0; + iVar2->axObj.info->unk15F = 0; + iVar3->axObj.info->unk15F = 0; + iVar4->axObj.info->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->info->unk15F = 1; + partnerEntity->axObj.info->unk15F = 1; while(sub_8085B80(&auStack_78)) { sub_803E46C(0x46); } - partnerEntity->info->unk15F = 0; - partnerEntity->info->unk15D = 1; + partnerEntity->axObj.info->unk15F = 0; + partnerEntity->axObj.info->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->info->unk15D = 0; + partnerEntity->axObj.info->unk15D = 0; sub_80869E4(partnerEntity,2,2,DIRECTION_NORTHWEST); puStack_30 = gUnknown_8107464; @@ -1015,13 +1015,13 @@ void ZapdosDropInEffect(Entity *zapdosEntity) { int iVar1; - zapdosEntity->info->unk15C = 1; - zapdosEntity->info->unk15E = 0; - zapdosEntity->info->unk174 = 200; + zapdosEntity->axObj.info->unk15C = 1; + zapdosEntity->axObj.info->unk15E = 0; + zapdosEntity->axObj.info->unk174 = 200; PlaySoundEffect(0x1ea); for(iVar1 = 200; iVar1 >= 0; iVar1 -= 5) { - zapdosEntity->info->unk174 = iVar1 * 256; + zapdosEntity->axObj.info->unk174 = iVar1 * 256; sub_803E46C(0x46); } sub_803E708(0x1e,0x46); @@ -1264,13 +1264,13 @@ void MoltresDropInEffect(Entity * moltresEntity) { s32 iVar1; - moltresEntity->info->unk15C = 1; - moltresEntity->info->unk15E = 0; - moltresEntity->info->unk174 = 0xc800; + moltresEntity->axObj.info->unk15C = 1; + moltresEntity->axObj.info->unk15E = 0; + moltresEntity->axObj.info->unk174 = 0xc800; PlaySoundEffect(0x1f8); for(iVar1 = 200; iVar1 >= 0; iVar1 -= 5) { - moltresEntity->info->unk174 = iVar1 * 256; + moltresEntity->axObj.info->unk174 = iVar1 * 256; sub_803E46C(0x46); } } @@ -1667,12 +1667,12 @@ void sub_8088484(Entity *param_1) { int iVar1; - param_1->info->unk15C = 1; - param_1->info->unk15E = 0; + param_1->axObj.info->unk15C = 1; + param_1->axObj.info->unk15E = 0; PlaySoundEffect(0x1ea); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 5) { - param_1->info->unk174 = iVar1 * 256; + param_1->axObj.info->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->info->unk15E = 0; - alakazamEntity->info->unk15E =0; + groudonEntity->axObj.info->unk15E = 0; + alakazamEntity->axObj.info->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->info->unk15F = 1; + r0->axObj.info->unk15F = 1; } void sub_80891D0(Entity *r0) { sub_806CDD4(r0, 7, DIRECTION_NORTH); - r0->info->unk15F = 0; + r0->axObj.info->unk15F = 0; } void sub_80891F0(void) @@ -2484,7 +2484,7 @@ void RayquazaDropInEffect(Entity *rayquazaEntity) s32 iVar1; s32 iVar2; - rayquazaEntity->info->unk15E = 0; + rayquazaEntity->axObj.info->unk15E = 0; iVar2 = 51200; iVar1 = 0x600; PlaySoundEffect(0x1f8); @@ -2495,10 +2495,10 @@ void RayquazaDropInEffect(Entity *rayquazaEntity) iVar1 = 0x14; } if (iVar2 < 0) break; - rayquazaEntity->info->unk174 = iVar2; + rayquazaEntity->axObj.info->unk174 = iVar2; sub_803E46C(0x46); } - rayquazaEntity->info->unk174 = 0; + rayquazaEntity->axObj.info->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->info->clientType == param_2)) { + if ((EntityExists(monEntity)) && (monEntity != entity) && (monEntity->axObj.info->clientType == param_2)) { return; } } @@ -2757,7 +2757,7 @@ void MewtwoDropInEffect(Entity *mewtwoEntity) s32 iVar1; s32 iVar2; - mewtwoEntity->info->unk15E = 0; + mewtwoEntity->axObj.info->unk15E = 0; iVar2 = 51200; iVar1 = 0x400; PlaySoundEffect(0x1f8); @@ -2768,10 +2768,10 @@ void MewtwoDropInEffect(Entity *mewtwoEntity) iVar1 = 0x1e; } if (iVar2 < 0) break; - mewtwoEntity->info->unk174 = iVar2; + mewtwoEntity->axObj.info->unk174 = iVar2; sub_803E46C(0x46); } - mewtwoEntity->info->unk174 = 0; + mewtwoEntity->axObj.info->unk174 = 0; } void MewtwoScreenFlash(void) @@ -3216,7 +3216,7 @@ void sub_808A528(Entity * param_1) s32 iVar1; s32 iVar2; - param_1->info->unk15E = 0; + param_1->axObj.info->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->info->unk174 = iVar2; + param_1->axObj.info->unk174 = iVar2; sub_803E46C(70); } - param_1->info->unk174 = 0; + param_1->axObj.info->unk174 = 0; } void SuicuneScreenFlash(void) @@ -3394,7 +3394,7 @@ void HoOhDropInEffect(Entity * param_1) s32 iVar1; s32 iVar2; - param_1->info->unk15E = 0; + param_1->axObj.info->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->info->unk174 = iVar2; + param_1->axObj.info->unk174 = iVar2; sub_803E46C(70); } - param_1->info->unk174 = 0; + param_1->axObj.info->unk174 = 0; } void HoOhScreenFlash(void) @@ -3845,7 +3845,7 @@ void sub_808B1CC(u8 itemID) void SetupRegiFacingDirection(Entity *regiEntity) { - regiEntity->info->action.direction = DIRECTION_NORTH; + regiEntity->axObj.info->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->info->unk15C = 1; - jirachiEntity->info->unk15E = 0; + jirachiEntity->axObj.info->unk15C = 1; + jirachiEntity->axObj.info->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->info->unk15C = 1; - jirachiEntity->info->unk15E = 0; + jirachiEntity->axObj.info->unk15C = 1; + jirachiEntity->axObj.info->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->info->unk15D = 0; + jirachiEntity->axObj.info->unk15D = 0; } if (wishChoice == 2) { // Lots of Items @@ -4095,7 +4095,7 @@ void JirachiWish(void) sub_8046860(jirachiEntity,&pos2,itemStack,9); } } - jirachiEntity->info->unk15D = 0; + jirachiEntity->axObj.info->unk15D = 0; } if (wishChoice == 3) @@ -4115,7 +4115,7 @@ void JirachiWish(void) DisplayDungeonDialogue(&gUnknown_8105AD4); sub_803E708(10,0x46); JirachiWishGrantDialogue(jirachiEntity); - jirachiEntity->info->unk15D = 0; + jirachiEntity->axObj.info->unk15D = 0; DisplayDungeonDialogue(&gUnknown_8105B20); UnlockFriendArea(friendArea); PlaySoundEffect(0xd4); @@ -4149,7 +4149,7 @@ void JirachiWish(void) sub_8046860(jirachiEntity,&pos3,strengthItems,4); } } - jirachiEntity->info->unk15D = 0; + jirachiEntity->axObj.info->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->info->unk15D = 0; + jirachiEntity->axObj.info->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->info,0); + sub_806BFC0(jirachiEntity->axObj.info,0); } void JirachiDropInEffect(Entity *jirachiEntity) @@ -4263,10 +4263,10 @@ void JirachiDropInEffect(Entity *jirachiEntity) iVar2 = 0x100; } if (iVar1 < 0) break; - jirachiEntity->info->unk174 = iVar1; + jirachiEntity->axObj.info->unk174 = iVar1; sub_803E46C(0x46); } - jirachiEntity->info->unk174 = 0; + jirachiEntity->axObj.info->unk174 = 0; } void JirachiSpinEffect(Entity * jirachiEntity) @@ -4278,7 +4278,7 @@ void JirachiSpinEffect(Entity * jirachiEntity) SetFacingDirection(jirachiEntity, uVar1 & DIRECTION_MASK); sub_803E708(3,0x46); } - jirachiEntity->info->unk15E = 1; + jirachiEntity->axObj.info->unk15E = 1; PlaySoundEffect(0x27f); sub_80861F8(99,jirachiEntity,1); } @@ -4287,7 +4287,7 @@ void JirachiWishGrantDialogue(Entity *jirachiEntity) { u32 uVar2; - jirachiEntity->info->unk15D = 1; + jirachiEntity->axObj.info->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->info->unk174 = iVar1 * 256; + entity->axObj.info->unk174 = iVar1 * 256; sub_803E46C(0x46); } for(iVar1 = 16; iVar1 < 200; iVar1 += 4){ - entity->info->unk174 = iVar1 * 256; + entity->axObj.info->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->info->action.direction = DIRECTION_NORTH; + param_1->axObj.info->action.direction = DIRECTION_NORTH; sub_806CE68(param_1, DIRECTION_NORTH); } diff --git a/src/dungeon_engine.c b/src/dungeon_engine.c index a81c336d1..040027660 100644 --- a/src/dungeon_engine.c +++ b/src/dungeon_engine.c @@ -110,7 +110,7 @@ static bool8 xxx_dungeon_80442D0(bool8 param_1) } else { - if (entity->info->attacking) { + if (entity->axObj.info->attacking) { return FALSE; } else @@ -127,7 +127,7 @@ static bool8 xxx_dungeon_80442D0(bool8 param_1) (gDungeon->unk673 != 0)))) { sub_803E46C(0xc); } - entity->info->speedStageChanged = FALSE; + entity->axObj.info->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->info; + entityInfo = entity->axObj.info; if ((entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY)) { - entity->info->flags = (entityInfo->flags & ~(MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY)) | MOVEMENT_FLAG_UNK_14; + entity->axObj.info->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->info->speedStageChanged) break; + if (!entity->axObj.info->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->info, (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) { + if ((EntityExists(entity)) && (entityInfo = entity->axObj.info, (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->info, (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) { + if ((EntityExists(entity)) && (pokemon != entity) && (entityInfo = entity->axObj.info, (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) { if (sub_8044B28()) break; RunMonsterAI(entity, 0); sub_8072CF4(entity); diff --git a/src/dungeon_items.c b/src/dungeon_items.c index 23fe2ac2e..0606099d4 100644 --- a/src/dungeon_items.c +++ b/src/dungeon_items.c @@ -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->info; + EntityInfo *pokemonInfo = pokemonInfo = pokemon->axObj.info; 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->info->id); + canLearnMove = CanMonLearnMove(moveID, entity->axObj.info->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->info; + entityInfo = entity->axObj.info; 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->info; + entityInfo = entity->axObj.info; item = &entityInfo->heldItem; if ((item->flags & ITEM_FLAG_EXISTS)) { xxx_init_itemslot_8090A8C(item, ITEM_PLAIN_SEED, 0); diff --git a/src/dungeon_leader.c b/src/dungeon_leader.c index 20db12ad8..20c7a7eee 100644 --- a/src/dungeon_leader.c +++ b/src/dungeon_leader.c @@ -14,7 +14,7 @@ Entity* GetLeader(void) for (i = 0; i < MAX_TEAM_MEMBERS; i++) { Entity *currentPokemon = gDungeon->teamPokemon[i]; - if (EntityExists(currentPokemon) && currentPokemon->info->isTeamLeader) + if (EntityExists(currentPokemon) && currentPokemon->axObj.info->isTeamLeader) { gLeaderPointer = currentPokemon; return currentPokemon; @@ -27,5 +27,5 @@ Entity* GetLeader(void) EntityInfo* GetLeaderInfo(void) { - return GetLeader()->info; + return GetLeader()->axObj.info; } diff --git a/src/dungeon_map_access.c b/src/dungeon_map_access.c index 62a4e1335..2df2c3114 100644 --- a/src/dungeon_map_access.c +++ b/src/dungeon_map_access.c @@ -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->info->flags; + u8 trapType = tileObject->axObj.info->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->info->flags; + u8 trapType = tileObject->axObj.info->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->info->flags; + u8 trapType = tileObject->axObj.info->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->info->flags; + u8 trapType = tileObject->axObj.info->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->info->flags; + u8 trapType = tileObject->axObj.info->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->info->flags; + u8 trapType = tileObject->axObj.info->flags; src = &dungeon->unk12A18[trapType][r6]; } else { diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 74744f760..b03916ea4 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -508,7 +508,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move gUnknown_202F208++; gUnknown_202F20C++; - targetInfo = currTarget->info; // currTarget could've been changed, hence info pointers needs to be reloaded + targetInfo = currTarget->axObj.info; // 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->info; + targetInfo = attacker->axObj.info; 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->info; + targetInfo = attacker->axObj.info; targetInfo->unk15A = 0; moveRedirected = TRUE; } @@ -2310,7 +2310,9 @@ s32 sub_8056564(Entity *entity, Position *pos, Move *move, s32 r4) sub_803E46C(0x5E); someRetVal = sub_800E710(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), 1)); if (someRetVal != -1) { - sub_800569C(&unkSp1.unk8, &entity->spriteInfo, someRetVal); + sub_800569C(&unkSp1.unk8, + &(*(struct EntitySpriteInfo *)&entity->axObj.axdata), + someRetVal); } else { unkSp1.unk8 = (Position) {0}; @@ -3020,7 +3022,7 @@ bool8 MoveMatchesChargingStatus(Entity *pokemon, Move *move) } else { - EntityInfo *pokemonInfo = pokemon->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; s32 i; for (i = 0; i < 100; i++) { @@ -3046,7 +3048,7 @@ bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge) } else { - EntityInfo *pokemonInfo = pokemon->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; int i = 0; u8 *chargingStatusPointer = &pokemonInfo->charging.chargingStatus; u8 *chargingStatusPointer2; @@ -3085,7 +3087,7 @@ u32 sub_8057144(Entity * pokemon) { Entity *dungeonMon = gDungeon->allPokemon[i]; if (EntityExists(dungeonMon)) { - Move *moves = dungeonMon->info->moves.moves; + Move *moves = dungeonMon->axObj.info->moves.moves; for (j = 0; j < MAX_MON_MOVES; j++) { if (moves[j].moveFlags & MOVE_FLAG_EXISTS @@ -3112,7 +3114,7 @@ bool8 sub_80571F0(Entity * pokemon, Move *move) s32 tileset; EntityInfo *entityInfo; - entityInfo = pokemon->info; + entityInfo = pokemon->axObj.info; if (entityInfo->unkFF == 1) { moveID = move->id; @@ -3151,7 +3153,7 @@ bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance) return FALSE; if (!EntityExists(pokemon) || !EntityExists(target)) return FALSE; - if (target->info->unk158 == 0 || target->info->HP == 0) + if (target->axObj.info->unk158 == 0 || target->axObj.info->HP == 0) return FALSE; if (chance != 0) { @@ -3214,7 +3216,7 @@ bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker) bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker) { - EntityInfo *pokemonInfo = pokemon->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; if (move->id == MOVE_REGULAR_ATTACK) { return TRUE; @@ -3255,7 +3257,7 @@ bool8 sub_805744C(Entity * pokemon, Move *move, bool8 param_3) { EntityInfo *entityInfo; - entityInfo = pokemon->info; + entityInfo = pokemon->axObj.info; if (move->id != MOVE_REGULAR_ATTACK) { if (((move->moveFlags & MOVE_FLAG_DISABLED)) || ((move->moveFlags2 & MOVE_FLAG_EXISTS))) { return FALSE; diff --git a/src/dungeon_movement.c b/src/dungeon_movement.c index 7c5eb8fb2..913a14687 100644 --- a/src/dungeon_movement.c +++ b/src/dungeon_movement.c @@ -73,7 +73,7 @@ u8 sub_80703A0(Entity *pokemon, Position *pos) u16 tileFlags; EntityInfo *entityInfo; - entityInfo = pokemon->info; + entityInfo = pokemon->axObj.info; 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->info; + entityInfo = pokemon->axObj.info; 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->info; + entityInfo = pokemon->axObj.info; 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->info; + entityInfo = pokemon->axObj.info; 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->info; + entityInfo = pokemon->axObj.info; 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->info == entityInfo)))) { + ((tile->monster == NULL) || ((GetEntityType(tile->monster) == ENTITY_MONSTER) && (tile->monster->axObj.info == 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->info; + entityInfo = pokemon->axObj.info; speed = 0; for(index = 0; index < NUM_SPEED_COUNTERS; index++) diff --git a/src/dungeon_music.c b/src/dungeon_music.c index fc486f8d9..1357eba5c 100644 --- a/src/dungeon_music.c +++ b/src/dungeon_music.c @@ -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->info; + targetEntityInfo = target->axObj.info; } - entityInfo = entity->info; + entityInfo = entity->axObj.info; if (targetEntityInfo != NULL) { sub_80709C8(buffer, targetEntityInfo); CopyStringtoBuffer(temp->buffer1, buffer); diff --git a/src/dungeon_pokemon_attributes.c b/src/dungeon_pokemon_attributes.c index a14667eb2..ed1d8fd2c 100644 --- a/src/dungeon_pokemon_attributes.c +++ b/src/dungeon_pokemon_attributes.c @@ -27,7 +27,7 @@ extern bool8 sub_805744C(Entity *, Move *, u32); bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage) { - if (target->info->protection.protectionStatus == STATUS_SAFEGUARD) { + if (target->axObj.info->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->info->protection.protectionStatus == STATUS_MIST) { + if (target->axObj.info->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->info; + entityInfo = pokemon->axObj.info; 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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info; + EntityInfo *pokemonInfo = pokemonInfo = pokemon->axObj.info; if (type == TYPE_NONE) { return FALSE; @@ -126,7 +126,7 @@ bool8 MonsterIsType(Entity *pokemon, u8 type) bool8 CanSeeInvisibleMonsters(Entity *pokemon) { - EntityInfo *pokemonInfo = pokemon->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; if (pokemonInfo->isTeamLeader) { bool8 isGoTheOtherWay = tactic == TACTIC_GO_THE_OTHER_WAY; @@ -151,12 +151,13 @@ bool8 HasTactic(Entity *pokemon, u8 tactic) bool8 IQSkillIsEnabled(Entity *pokemon, u8 IQSkill) { - return IsIQSkillSet(pokemon->info->IQSkillFlags, 1 << IQSkill); + return IsIQSkillSet(pokemon->axObj.info->IQSkillFlags, 1 << IQSkill); } bool8 IQSkillPairIsEnabled(Entity *pokemon, u8 IQSkill1, u8 IQSkill2) { - return IsIQSkillSet(pokemon->info->IQSkillFlags, 1 << IQSkill1 | 1 << IQSkill2); + return IsIQSkillSet(pokemon->axObj.info->IQSkillFlags, + 1 << IQSkill1 | 1 << IQSkill2); } void LoadIQSkills(Entity *pokemon) @@ -165,7 +166,7 @@ void LoadIQSkills(Entity *pokemon) s32 IQSkill; EntityInfo *pokemonInfo; - pokemonInfo = pokemon->info; + pokemonInfo = pokemon->axObj.info; if (pokemonInfo->isNotTeamMember) { iVar2 = pokemonInfo->IQSkillFlags; SetIQSkill(iVar2, IQ_STATUS_CHECKER); @@ -197,7 +198,7 @@ bool8 CanSeeTeammate(Entity * pokemon) Entity *teamMember; s32 memberIdx; - if (pokemon->info->isNotTeamMember) { + if (pokemon->axObj.info->isNotTeamMember) { return FALSE; } else @@ -217,7 +218,7 @@ bool8 CanSeeTeammate(Entity * pokemon) u8 GetMoveTypeForMonster(Entity *pokemon, Move *pokeMove) { if (pokeMove->id == MOVE_HIDDEN_POWER) - return pokemon->info->hiddenPower.hiddenPowerType; + return pokemon->axObj.info->hiddenPower.hiddenPowerType; else return GetMoveType(pokeMove); } @@ -225,7 +226,7 @@ u8 GetMoveTypeForMonster(Entity *pokemon, Move *pokeMove) s32 GetMovePower(Entity *pokemon, Move *pokeMove) { if(pokeMove->id == MOVE_HIDDEN_POWER) - return (pokemon->info->hiddenPower.hiddenPowerBasePower + pokeMove->ginseng); + return (pokemon->axObj.info->hiddenPower.hiddenPowerBasePower + pokeMove->ginseng); else return (GetMoveBasePower(pokeMove) + pokeMove->ginseng); } @@ -251,7 +252,7 @@ bool8 sub_8071A8C(Entity *pokemon) EntityInfo *pokemonInfo; if(EntityExists(pokemon)) { - pokemonInfo = pokemon->info; + pokemonInfo = pokemon->axObj.info; if(pokemonInfo->clientType != CLIENT_TYPE_CLIENT) { if(!sub_8071A8C_sub(pokemonInfo)) diff --git a/src/dungeon_util.c b/src/dungeon_util.c index 6cf0495de..b495be2ab 100644 --- a/src/dungeon_util.c +++ b/src/dungeon_util.c @@ -47,22 +47,22 @@ u8 GetEntityRoom(Entity *entity) Trap* GetTrapData(Entity *entity) { - return (Trap *)entity->info; + return (Trap *) entity->axObj.info; } Item* GetItemData(Entity *entity) { - return (Item *)entity->info; + return (Item *) entity->axObj.info; } Trap* GetTrapData_1(Entity *entity) { - return (Trap *)entity->info; + return (Trap *) entity->axObj.info; } Item* GetItemData_1(Entity *entity) { - return (Item*)entity->info; + return (Item*) entity->axObj.info; } Tile *GetTileAtEntity(Entity *entity) @@ -141,7 +141,7 @@ void sub_804522C(void) { } else { - info = entity->info; + info = entity->axObj.info; statusSprites = EntityGetStatusSprites(entity); UpdateDungeonPokemonSprite(info->unk98, info->apparentID, statusSprites, FALSE); } diff --git a/src/dungeon_util_1.c b/src/dungeon_util_1.c index 44f092656..2b347f7e3 100644 --- a/src/dungeon_util_1.c +++ b/src/dungeon_util_1.c @@ -37,7 +37,7 @@ Entity *GetPartnerEntity(void) for(counter = 0; counter < MAX_TEAM_MEMBERS; counter++) { entity = gDungeon->teamPokemon[counter]; - if(EntityExists(entity) && entity->info->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER) + if(EntityExists(entity) && entity->axObj.info->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->info->isTeamLeader) + if(entity2 != NULL && entity2->axObj.info->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->info->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER) + if(entity3 != NULL && entity3->axObj.info->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->info->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER) { + if (entity->axObj.info->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->info->joinedAt.joinedAt != 0x41)) { + if ((EntityExists(entity)) && (entity->axObj.info->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->info->clientType == entityType)) return entity; + if ((EntityExists(entity)) && (entity->axObj.info->clientType == entityType)) return entity; } return NULL; } @@ -174,7 +174,7 @@ void sub_80856E0(Entity * pokemon, s32 direction) EntityInfo *entityInfo; s32 counter; - entityInfo = pokemon->info; + entityInfo = pokemon->axObj.info; 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->info->clientType == CLIENT_TYPE_PARTNER)) { + if ((EntityExists(entity)) && (entity->axObj.info->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->info; + entityInfo = entity->axObj.info; 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->info->action.direction = direction & DIRECTION_MASK; + pokemon->axObj.info->action.direction = direction & DIRECTION_MASK; sub_806CE68(pokemon, direction); } @@ -293,7 +293,7 @@ void sub_8085930(s32 direction) } else { - entity->info->action.direction = direction & DIRECTION_MASK; + entity->axObj.info->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->info->clientType == CLIENT_TYPE_PARTNER) + if(entity->axObj.info->clientType == CLIENT_TYPE_PARTNER) { if(direction >= NUM_DIRECTIONS) { @@ -311,7 +311,7 @@ void sub_8085930(s32 direction) } else { - entity->info->action.direction = direction & DIRECTION_MASK; + entity->axObj.info->action.direction = direction & DIRECTION_MASK; sub_806CE68(entity, direction); } } @@ -334,7 +334,7 @@ void sub_80859F0(s32 direction) } else { - entity->info->action.direction = direction & DIRECTION_MASK; + entity->axObj.info->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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; switch (pokemonInfo->clientType) { case CLIENT_TYPE_CLIENT: diff --git a/src/dungeon_visibility.c b/src/dungeon_visibility.c index bd5a2b226..129d11d76 100644 --- a/src/dungeon_visibility.c +++ b/src/dungeon_visibility.c @@ -16,16 +16,16 @@ bool8 CanSeeTarget(Entity *entity, Entity *targetEntity) { if (entity->type == ENTITY_MONSTER) { - if (!CanSeeInvisibleMonsters(entity) && targetEntity->info->transformStatus.transformStatus == STATUS_INVISIBLE) + if (!CanSeeInvisibleMonsters(entity) && targetEntity->axObj.info->transformStatus.transformStatus == STATUS_INVISIBLE) { return FALSE; } - if (entity->info->eyesightStatus.eyesightStatus == STATUS_BLINKER) + if (entity->axObj.info->eyesightStatus.eyesightStatus == STATUS_BLINKER) { return FALSE; } } - else if (targetEntity->info->transformStatus.transformStatus == STATUS_INVISIBLE) + else if (targetEntity->axObj.info->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->info->transformStatus.transformStatus == STATUS_INVISIBLE) + if (!CanSeeInvisibleMonsters(entity) && targetEntity->axObj.info->transformStatus.transformStatus == STATUS_INVISIBLE) { return FALSE; } - if (entity->info->eyesightStatus.eyesightStatus == STATUS_BLINKER) + if (entity->axObj.info->eyesightStatus.eyesightStatus == STATUS_BLINKER) { return FALSE; } } - else if (targetEntity->info->transformStatus.transformStatus == STATUS_INVISIBLE) + else if (targetEntity->axObj.info->transformStatus.transformStatus == STATUS_INVISIBLE) { return FALSE; } diff --git a/src/move_actions.c b/src/move_actions.c index f5824575a..73848e344 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -238,7 +238,7 @@ void sub_8057588(Entity * pokemon, u8 param_2) EntityInfo *entityInfo; if (EntityExists(pokemon)) { - entityInfo = pokemon->info; + entityInfo = pokemon->axObj.info; 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->info->HP / 2; + newHP = target->axObj.info->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->info; + entityInfo = target->axObj.info; 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->info->charging.chargingStatus; + chargeStatus = target->axObj.info->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->info; + entityInfo = pokemon->axObj.info; 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->info; + entityInfo = pokemon->axObj.info; 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->info->unk152 == 0) { - target->info->unk152 = 1; + if (target->axObj.info->unk152 == 0) { + target->axObj.info->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->info; + entityInfo = pokemon->axObj.info; r6 = 1; @@ -785,7 +785,7 @@ bool8 GrudgeMoveAction(Entity *pokemon, Entity * target, Move *move, s32 param_4 bool8 hasGrudge; hasGrudge = FALSE; - entityInfo = target->info; + entityInfo = target->axObj.info; 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->info->charging.chargingStatus - 7) <= 1) + if((u8)(target->axObj.info->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->info->unkA0 * 2; + iVar2 = pokemon->axObj.info->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->info; - entityInfo1 = target->info; + entityInfo = pokemon->axObj.info; + entityInfo1 = target->axObj.info; 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->info->nonVolatile.nonVolatileStatus) != STATUS_NONE) + if((pokemon->axObj.info->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->info->protection.protectionStatus == STATUS_REFLECT) || (target->info->protection.protectionStatus == STATUS_LIGHT_SCREEN)) { + if ((target->axObj.info->protection.protectionStatus == STATUS_REFLECT) || (target->axObj.info->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->info; + entityInfo = pokemon->axObj.info; 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->info->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) { + if (target->axObj.info->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->info; + EntityInfo *entityInfo = target->axObj.info; 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->info; + entityInfo = pokemon->axObj.info; 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->info; + entityInfo = pokemon->axObj.info; 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->info->level) / 256; + rand = (rand * pokemon->axObj.info->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->info; - iVar3 = target->info; + iVar4 = pokemon->axObj.info; + iVar3 = target->axObj.info; 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->info->maxHPStat; + iVar2 = pokemon->axObj.info->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->info->maxHPStat / 2, 0, TRUE); + HealTargetHP(pokemon, target, target->axObj.info->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->info; + entityInfo = target->axObj.info; 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->info->maxHPStat; + HP = pokemon->axObj.info->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->info->charging.chargingStatus - 7) <= 1){ + if ((u8)(target->axObj.info->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->info->maxHPStat; + HP = target->axObj.info->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->info->level; + level = pokemon->axObj.info->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->info; + info = target->axObj.info; 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->info,0); + SetMessageArgument_2(gAvailablePokemonNames,pokemon->axObj.info,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->info,0); + SetMessageArgument_2(gAvailablePokemonNames,pokemon->axObj.info,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->info; + r9 = pokemon->axObj.info; r7 = r9; - r8 = target->info; + r8 = target->axObj.info; 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->info->charging.chargingStatus == STATUS_DIVING) { + if (target->axObj.info->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->info; - targetEntityInfo = target->info; + entityInfo = pokemon->axObj.info; + targetEntityInfo = target->axObj.info; 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->info->stockpileStage; + stockpileStage = &target->axObj.info->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->info; + entityInfo = pokemon->axObj.info; 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->info->stockpileStage; + stockpileStage = &pokemon->axObj.info->stockpileStage; if (*stockpileStage != 0) { HandleDamagingMove(pokemon,target,move,*stockpileStage << 8,param_4); *stockpileStage = 0; @@ -2644,7 +2644,7 @@ void sub_805A7D4(Entity * pokemon, Entity * target, Item *item, Position *pos) stackEntity.unk24 = 0; stackEntity.isVisible = TRUE; stackEntity.unk22 = 0; - stackEntity.info = (EntityInfo*) item; + stackEntity.axObj.info = (EntityInfo*) item; // This seems wrong! stackEntity.pos.x = target->pos.x + pos->x; stackEntity.pos.y = target->pos.y + pos->y; SetEntityPixelPos(&stackEntity,(target->pos.x * 0x18 + 4) * 0x100, @@ -2748,7 +2748,7 @@ _0805AA5E: if (sub_80706A4(target, pos)) { sub_807D148(pokemon,target,0,0); } - if (target->info->isTeamLeader) { + if (target->axObj.info->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->info; + info = pokemon->axObj.info; flag = FALSE; if (FixedPointToInt(info->belly) > 1) { RaiseAttackStageTarget(pokemon,target,gUnknown_8106A4C,99); @@ -2955,7 +2955,7 @@ bool8 PresentMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param } else { if (rand1 < 30) { - HealTargetHP(pokemon,target,target->info->maxHPStat/4,0,TRUE); + HealTargetHP(pokemon,target,target->axObj.info->maxHPStat/4,0,TRUE); return TRUE; } else if (rand2 >= 60) { diff --git a/src/move_checks.c b/src/move_checks.c index 34390b1eb..87355c465 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -104,7 +104,7 @@ const u8 gDungeonCamouflageTypes[76] = { bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) { - EntityInfo *pokemonInfo = pokemon->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; switch (move->id) { case MOVE_HAIL: @@ -172,7 +172,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) #else r1 = 0; #endif - if (pokemon->info->speedStage >= MAX_SPEED_STAGE) + if (pokemon->axObj.info->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->info->speedStage >= MAX_SPEED_STAGE) + if (pokemonInfo->offensiveStages[STAT_STAGE_ATK] >= MAX_STAT_STAGE && pokemon->axObj.info->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->info->offensiveStages[STAT_STAGE_ATK] >= MAX_STAT_STAGE) + if (target->axObj.info->offensiveStages[STAT_STAGE_ATK] >= MAX_STAT_STAGE) { continue; } - if (target->info->offensiveStages[STAT_STAGE_SP_ATK] < MAX_STAT_STAGE) + if (target->axObj.info->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->info->offensiveStages[STAT_STAGE_ATK] >= MAX_STAT_STAGE) + if (target->axObj.info->offensiveStages[STAT_STAGE_ATK] >= MAX_STAT_STAGE) { continue; } - if (target->info->offensiveStages[STAT_STAGE_SP_ATK] < MAX_STAT_STAGE) + if (target->axObj.info->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->info; - EntityInfo *targetData = target->info; + EntityInfo *userData = user->axObj.info; + EntityInfo *targetData = target->axObj.info; 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->info->speedStage <= 0) + if (target->axObj.info->speedStage <= 0) { return FALSE; } diff --git a/src/move_effects_target.c b/src/move_effects_target.c index 5c3986cb0..b568571d5 100644 --- a/src/move_effects_target.c +++ b/src/move_effects_target.c @@ -152,7 +152,7 @@ extern void nullsub_69(Entity *, Entity *); void sub_8075BA4(Entity *param_1, u8 param_2) { - EntityInfo * entityInfo = param_1->info; + EntityInfo * entityInfo = param_1->axObj.info; 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->info; + entityInfo = pokemon->axObj.info; 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->info->sleep.sleep; + sleep = target->axObj.info->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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; - targetEntityInfo = target->info; + pokemonEntityData = pokemon->axObj.info; + targetEntityInfo = target->axObj.info; 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->info; + entityInfo = entity->axObj.info; 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->info; + targetEntityInfo = target->axObj.info; 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->info; + entityInfo = entity->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); sub_8041F94(target,index); if (index != STAT_STAGE_DEF) { diff --git a/src/status.c b/src/status.c index a30306549..cca726457 100644 --- a/src/status.c +++ b/src/status.c @@ -190,7 +190,7 @@ u8 GetFlashFireStatus(Entity *pokemon) { return FLASH_FIRE_STATUS_NONE; } - if (pokemon->info->flashFireBoost > 1) + if (pokemon->axObj.info->flashFireBoost > 1) { return FLASH_FIRE_STATUS_MAXED; } @@ -216,7 +216,7 @@ void UpdateFlashFireBoost(Entity * pokemon, Entity *target) s32 flashFireBoost; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; entityInfo_1 = entityInfo; SetMessageArgument(gAvailablePokemonNames,target,0); flashFireBoost = UpdateFlashFireBoost_sub(entityInfo); @@ -261,7 +261,7 @@ void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage return; } - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); oldMulti = entityInfo->offensiveMultipliers[statStage]; @@ -312,7 +312,7 @@ void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStag return; } - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); oldMulti = entityInfo->defensiveMultipliers[statStage]; @@ -349,7 +349,7 @@ void RaiseAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); sub_8042040(target,statStage); if (statStage != STAT_STAGE_ACCURACY) { @@ -389,7 +389,7 @@ void LowerAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage, } } else { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); sub_8042060(target,statStage); if (entityInfo->hitChanceStages[statStage] != 0) { @@ -417,7 +417,7 @@ void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC18); } else { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if(entityInfo->volatileStatus.volatileStatus != STATUS_CRINGE) { @@ -455,7 +455,7 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag else { bVar6 = TRUE; - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->nonVolatile.nonVolatileStatus != STATUS_PARALYSIS) { entityInfo->nonVolatile.nonVolatileStatus = STATUS_PARALYSIS; @@ -507,7 +507,7 @@ void RaiseMovementSpeedTarget(Entity * pokemon, Entity * target, s32 turns, bool if (turns == 0) { turns = CalculateStatusTurns(target,gUnknown_80F4E40,FALSE) + 1; } - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); movSpeed = CalcSpeedStage(target); if (movSpeed == MAX_SPEED_STAGE) { @@ -552,7 +552,7 @@ void LowerMovementSpeedTarget(Entity * pokemon, Entity * target, s32 levels, boo if (HasSafeguardStatus(pokemon,target,displayMessage)) { return; } - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); movSpeed = CalcSpeedStage(target); if (movSpeed == 0) { @@ -610,7 +610,7 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage else { sub_8041BE8(target); - entityInfo = target->info; + entityInfo = target->axObj.info; if (entityInfo->volatileStatus.volatileStatus != STATUS_CONFUSED) { entityInfo->volatileStatus.volatileStatus = STATUS_CONFUSED; entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E4C,TRUE) + 1; @@ -629,7 +629,7 @@ void CowerStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) EntityInfo *entityInfo; if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->volatileStatus.volatileStatus != STATUS_COWERING) { entityInfo->volatileStatus.volatileStatus = STATUS_COWERING; @@ -658,7 +658,7 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo return; } - entityInfo = target->info; + entityInfo = target->axObj.info; maxHPStat = entityInfo->maxHPStat; HP = entityInfo->HP; if (((entityInfo->HP == entityInfo->maxHPStat) && (0 < param_4)) || (param_3 == 0)) { @@ -727,12 +727,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->info->scanning) { + if (target->axObj.info->scanning) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEF0); // Item locations are already known } else { - target->info->scanning = TRUE; + target->axObj.info->scanning = TRUE; nullsub_75(target); SetMessageArgument(gAvailablePokemonNames, target, 0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEA0); // Item locations became evident @@ -752,12 +752,12 @@ void HandleStairsOrb(Entity* pokemon, Entity* target) } else { - if (target->info->stairSpotter) { + if (target->axObj.info->stairSpotter) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAF1C); } else { - target->info->stairSpotter = TRUE; + target->axObj.info->stairSpotter = TRUE; nullsub_76(target); SetMessageArgument(gAvailablePokemonNames,target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEC8); @@ -772,12 +772,12 @@ void HandleStairsOrb(Entity* pokemon, Entity* target) void HandleRadarOrb(Entity* pokemon, Entity* target) { if (EntityExists(target)) { - if (target->info->powerEars != 0) { + if (target->axObj.info->powerEars != 0) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAFD0); } else { - target->info->powerEars = TRUE; + target->axObj.info->powerEars = TRUE; nullsub_77(target); SetMessageArgument(gAvailablePokemonNames,target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAFAC); @@ -795,7 +795,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) s32 index; if ((EntityExists(target)) && (GetEntityType(pokemon) == ENTITY_MONSTER)) { - entityInfo = target->info; + entityInfo = target->axObj.info; if (pokemon == target) { pokemon = target; if (displayMessage) @@ -831,7 +831,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) { if (pokemon == gDungeon->allPokemon[index]) { entityInfo->linked.unkD8 = index; - entityInfo2 = pokemon->info; + entityInfo2 = pokemon->axObj.info; entityInfo->linked.unkD4 = entityInfo2->unk98; } } @@ -849,12 +849,12 @@ void sub_8078084(Entity * pokemon) Entity *target; s32 index; - entityInfo = pokemon->info; + entityInfo = pokemon->axObj.info; for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { target = gDungeon->allPokemon[index]; if (EntityExists(target)) { - entityInfo2 = target->info; + entityInfo2 = target->axObj.info; if((u8)(entityInfo2->linked.linkedStatus - 1) <= 1) { if(entityInfo2->linked.unkD4 == entityInfo->unk98) @@ -877,7 +877,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) if (((EntityExists(target)) && (GetEntityType(pokemon) == ENTITY_MONSTER)) && (GetEntityType(target) == ENTITY_MONSTER)) { - entityInfo = pokemon->info; + entityInfo = pokemon->axObj.info; SetMessageArgument(gAvailablePokemonNames,pokemon,0); linkedStatus = &entityInfo->linked.linkedStatus; if (entityInfo->linked.linkedStatus != STATUS_DESTINY_BOND) @@ -900,7 +900,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) { if (target == gDungeon->allPokemon[index]) { entityInfo->linked.unkD8 = index; - entityInfo2 = target->info; + entityInfo2 = target->axObj.info; entityInfo->linked.unkD4 = entityInfo2->unk98; } } @@ -914,7 +914,7 @@ void SureShotStatusTarget(Entity *pokemon, Entity * target, s32 turns) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->moveStatus.moveStatus != STATUS_SURE_SHOT) { entityInfo->moveStatus.moveStatus = STATUS_SURE_SHOT; @@ -934,7 +934,7 @@ void WhifferStatusTarget(Entity *pokemon, Entity * target, s32 turns) EntityInfo *entityInfo; if (EntityExists(target) && !HasSafeguardStatus(pokemon, target, TRUE)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->moveStatus.moveStatus != STATUS_WHIFFER) { entityInfo->moveStatus.moveStatus = STATUS_WHIFFER; @@ -954,7 +954,7 @@ void FixedDamageStatusTarget(Entity *pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->moveStatus.moveStatus != STATUS_SET_DAMAGE) { entityInfo->moveStatus.moveStatus = STATUS_SET_DAMAGE; @@ -974,7 +974,7 @@ void FocusEnergyStatusTarget(Entity *pokemon, Entity * target) EntityInfo *entityInfo; if (EntityExists(target)) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->moveStatus.moveStatus != STATUS_FOCUS_ENERGY) { entityInfo->moveStatus.moveStatus = STATUS_FOCUS_ENERGY; @@ -999,7 +999,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) s32 index; if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { - targetEntityInfo = target->info; + targetEntityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (targetEntityInfo->waitingStruct.waitingStatus == STATUS_DECOY) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB994); @@ -1009,7 +1009,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) { entity = gDungeon->allPokemon[index]; if ((((EntityExists(entity)) && (target != entity)) && - (u8)(entity->info->waitingStruct.waitingStatus - 2U) < 2)) { + (u8)(entity->axObj.info->waitingStruct.waitingStatus - 2U) < 2)) { SendWaitingEndMessage(pokemon,entity,STATUS_NONE); sub_803E46C(0x2a); } @@ -1020,7 +1020,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->info->isNotTeamMember; + targetEntityInfo->waitingStruct.enemyDecoy = pokemon->axObj.info->isNotTeamMember; targetEntityInfo->waitingStruct.unkCA = param_3; targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED0,TRUE) + 1; targetEntityInfo->waitingStruct.curseDamageCountdown = 0; @@ -1032,7 +1032,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) { entity2 = gDungeon->allPokemon[index]; if (EntityExists(entity2)) { - entityInfo = entity2->info; + entityInfo = entity2->axObj.info; entityInfo->aiTarget.aiObjective = AI_STAND_STILL; entityInfo->aiTarget.aiTarget = NULL; entityInfo->aiTarget.aiTargetSpawnGenID = 0; @@ -1057,8 +1057,8 @@ void CurseStatusTarget(Entity *pokemon, Entity * target) if ((EntityExists(pokemon) ) && (EntityExists(target))) { - pokemonEntityData = pokemon->info; - targetEntityInfo = target->info; + pokemonEntityData = pokemon->axObj.info; + targetEntityInfo = target->axObj.info; if (MonsterIsType(pokemon, TYPE_GHOST)) { if (HasSafeguardStatus(pokemon,target, TRUE)) { return; @@ -1100,7 +1100,7 @@ void SnatchStatusTarget(Entity * pokemon, Entity * target) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { entity = gDungeon->allPokemon[index]; - if ((EntityExists(entity)) && (entity->info->waitingStruct.waitingStatus == STATUS_SNATCH)) { + if ((EntityExists(entity)) && (entity->axObj.info->waitingStruct.waitingStatus == STATUS_SNATCH)) { SendWaitingEndMessage(pokemon, entity, STATUS_NONE); } } @@ -1126,7 +1126,7 @@ void TauntStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->volatileStatus.volatileStatus != STATUS_TAUNTED) { entityInfo->volatileStatus.volatileStatus = STATUS_TAUNTED; @@ -1146,7 +1146,7 @@ void HandleStockpile(Entity * pokemon, Entity * target) EntityInfo *entityInfo; if ((EntityExists(target))) { - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->stockpileStage < MAX_STOCKPILE_STAGE) { entityInfo->stockpileStage++; @@ -1168,7 +1168,7 @@ void InvisibleStatusTarget(Entity * pokemon, Entity * target) EntityInfo * targetEntityInfo_1; if (EntityExists(target)) { - targetEntityInfo = target->info; + targetEntityInfo = target->axObj.info; targetEntityInfo_1 = targetEntityInfo; if (targetEntityInfo_1->transformStatus.transformStatus == STATUS_TRANSFORMED) { SendTransformEndMessage(pokemon,target); @@ -1193,7 +1193,7 @@ void PerishSongTarget(Entity * pokemon, Entity * target) if (EntityExists(target) && !HasSafeguardStatus(pokemon, target, TRUE)) { nullsub_82(target); - entityInfo = target->info; + entityInfo = target->axObj.info; SetMessageArgument(gAvailablePokemonNames,target,0); if (entityInfo->perishSongTurns == 0) { entityInfo->perishSongTurns = CalculateStatusTurns(target,gUnknown_80F4EEC,FALSE) + 1; @@ -1212,7 +1212,7 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target) int index; EntityInfo *EntityInfo; - EntityInfo = target->info; + EntityInfo = target->axObj.info; if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { for(index = 0; index < MAX_MON_MOVES; index++) { @@ -1247,7 +1247,7 @@ void sub_8078A58(struct Entity *pokemon, struct Entity *target, s32 param_3, s32 if (!EntityExists(target)) return; - targetInfo = target->info; + targetInfo = target->axObj.info; if (param_4 != 0) { FixedPoint sp0 = IntToFixedPoint(param_4); @@ -1300,7 +1300,7 @@ void sub_8078B5C(Entity *pokemon, Entity *target, u32 bellyIncrement, s32 maxBel if (!EntityExists(target)) { return; } - targetInfo = target->info; + targetInfo = target->axObj.info; if ((!targetInfo->isTeamLeader) && (HasHeldItem(target,0x1b))) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBEA0); return; diff --git a/src/status_actions.c b/src/status_actions.c index 98e4ae869..4bcbc6ae4 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -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->info->action.direction); + sub_807CD9C(pokemon, target, pokemon->axObj.info->action.direction); return TRUE; } @@ -219,7 +219,7 @@ bool8 HandleColorChange(Entity * pokemon, Entity * target) const char *typeString; EntityInfo *entityInfo; - entityInfo = target->info; + entityInfo = target->axObj.info; 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->info->isNotTeamMember; + isNotTeamMember = pokemon->axObj.info->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->info; + entityInfo = target->axObj.info; 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->info; + entityInfo = pokemon->axObj.info; 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->info; - targetEntityInfo = target->info; + entityInfo = pokemon->axObj.info; + targetEntityInfo = target->axObj.info; 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->info; + entityInfo = pokemon->axObj.info; 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->info->maxHPStat; + entityHP = pokemon->axObj.info->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->info; - iVar3 = pokemon->info; - iVar5 = target->info; - iVar6 = target->info; + iVar2 = pokemon->axObj.info; + iVar3 = pokemon->axObj.info; + iVar5 = target->axObj.info; + iVar6 = target->axObj.info; 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->info; - targetHP = target->info->HP - 1; + entityInfo = pokemon->axObj.info; + targetHP = target->axObj.info->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->info->isNotTeamMember) { - entityInfo = target->info; + if (target->axObj.info->isNotTeamMember) { + entityInfo = target->axObj.info; 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->info->isNotTeamMember) { + if (pokemon->axObj.info->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->info->apparentID); + targetSize = GetSize(target->axObj.info->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->info; + targetInfo = target->axObj.info; 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->info->isNotTeamMember ? 2 : 1); + var = (target->axObj.info->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->info->clientType != CLIENT_TYPE_NONE) + if(target->axObj.info->clientType != CLIENT_TYPE_NONE) { TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FF678); return FALSE; diff --git a/src/status_checks.c b/src/status_checks.c index 0b9d490e3..b7da5558f 100644 --- a/src/status_checks.c +++ b/src/status_checks.c @@ -27,7 +27,7 @@ extern char *gPtrMoveInterruptedMessage[]; bool8 HasStatusAffectingActions(Entity *pokemon) { - EntityInfo *pokemonInfo = pokemon->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info; + pokemonInfo = pokemon->axObj.info; flag = FALSE; SetMessageArgument(gAvailablePokemonNames, pokemon, 0); SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); diff --git a/src/status_checks_1.c b/src/status_checks_1.c index e76528ec1..bf93cb654 100644 --- a/src/status_checks_1.c +++ b/src/status_checks_1.c @@ -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->info, 0x40, flag)) { + if (displayMessage && SetVisualFlags(pokemon->axObj.info, 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->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; 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->info->sleep.sleep != STATUS_SLEEP && - pokemon->info->sleep.sleep != STATUS_NAPPING && - pokemon->info->sleep.sleep != STATUS_NIGHTMARE) + if (pokemon->axObj.info->sleep.sleep != STATUS_SLEEP && + pokemon->axObj.info->sleep.sleep != STATUS_NAPPING && + pokemon->axObj.info->sleep.sleep != STATUS_NIGHTMARE) { return FALSE; } diff --git a/src/targeting.c b/src/targeting.c index 2f4efe4e5..915b7cc89 100644 --- a/src/targeting.c +++ b/src/targeting.c @@ -5,7 +5,7 @@ void TargetTileInFront(Entity *pokemon) { - EntityInfo *pokemonInfo = pokemon->info; + EntityInfo *pokemonInfo = pokemon->axObj.info; pokemonInfo->targetPos.x = pokemon->pos.x + gAdjacentTileOffsets[pokemonInfo->action.direction].x; pokemonInfo->targetPos.y = pokemon->pos.y + gAdjacentTileOffsets[pokemonInfo->action.direction].y; } diff --git a/src/trap.c b/src/trap.c index 3f1b27dcd..04d63fed7 100644 --- a/src/trap.c +++ b/src/trap.c @@ -497,7 +497,7 @@ void HandleGrimyTrap(Entity *pokemon, Entity *target) badFoodCount = 0; if (target != NULL) { - info = target->info; + info = target->axObj.info; 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->info; + info = target->axObj.info; 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->info; + info = param_2->axObj.info; 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->info; + info = param_2->axObj.info; counter = 0; for(i = 0; i < MAX_MON_MOVES;i++) { diff --git a/src/trap_1.c b/src/trap_1.c index c4f35d0db..14d7fd125 100644 --- a/src/trap_1.c +++ b/src/trap_1.c @@ -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->info; + info = target->axObj.info; 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->info; + info = param_2->axObj.info; sub_8082FA8(param_1,&uStack_ac,1); sub_8082FA8(param_1,¶m_2->pos.x,1); sub_8082FA8(param_1,¶m_2->pos.y,1); diff --git a/src/type_effectiveness.c b/src/type_effectiveness.c index d581e09e2..376ed08af 100644 --- a/src/type_effectiveness.c +++ b/src/type_effectiveness.c @@ -92,8 +92,8 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct bVar4 = FALSE; normalOrFightingType = FALSE; - pokemonInfo = pokemon->info; - targetInfo = target->info; + pokemonInfo = pokemon->axObj.info; + targetInfo = target->axObj.info; 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->info; - targetData = target->info; + userData = user->axObj.info; + targetData = target->axObj.info; if (moveType == TYPE_FIRE && GetFlashFireStatus(target) != FLASH_FIRE_STATUS_NONE) { return 0; diff --git a/tmp/entityfix.cocci b/tmp/entityfix.cocci new file mode 100644 index 000000000..322e1c3ba --- /dev/null +++ b/tmp/entityfix.cocci @@ -0,0 +1,76 @@ +@@ +Entity *e; +@@ + +- e->spriteInfo ++ (*(struct EntitySpriteInfo *)&e->axObj.axdata) + +@@ +Entity *e; +@@ + +- e->sprite ++ e->axObj.spriteFile + +@@ +Entity *e; +@@ + +- e->unk68 ++ e->axObj.unk40_maybeAnimTimer + +@@ +Entity *e; +@@ + +- e->unk6A ++ e->axObj.unk42_animId1 + +@@ +Entity *e; +@@ + +- e->unk6B ++ e->axObj.unk43_animId2 + +@@ +Entity *e; +@@ + +- e->direction ++ e->axObj.unk44_direction1 + +@@ +Entity *e; +@@ + +- e->direction2 ++ e->axObj.unk45_orientation + +@@ +Entity *e; +@@ + +- e->unk6E ++ e->axObj.unk46 + +@@ +Entity *e; +@@ + +- e->unk6F ++ e->axObj.unk47 + +@@ +Entity *e; +@@ + +- e->info ++ e->axObj.info + +@@ +Entity e; +@@ + +- e.info ++ e.axObj.info diff --git a/tmp/files b/tmp/files new file mode 100644 index 000000000..94dcbb08a --- /dev/null +++ b/tmp/files @@ -0,0 +1,64 @@ +src/code_805D8C8_1.c +src/move_util.c +src/code_8085E98.c +src/sprite.c +src/code_8040094.c +src/code_8048480.c +src/status_checks_1.c +src/targeting.c +src/dungeon_util_1.c +src/code_804267C.c +src/code_805D8C8.c +src/code_808417C.c +src/charge_move.c +src/dungeon_util.c +src/dungeon_ai_attack.c +src/code_806E8B0.c +src/dungeon_ai.c +src/code_806CD90.c +src/code_8077274_1.c +src/move_checks.c +src/trap.c +src/dungeon_music.c +src/targeting_flags.c +src/code_8083288.c +src/dungeon_ai_movement.c +src/dungeon_pokemon_attributes.c +src/dungeon_visibility.c +src/code_80848F0.c +src/status.c +src/dungeon_items.c +src/dungeon_ai_item_weight.c +src/code_80869E4.c +src/code_8086A3C.c +src/code_8041AD0.c +src/move_actions.c +src/type_effectiveness.c +src/dungeon_movement.c +src/dungeon_capabilities.c +src/code_8075708.c +src/dungeon_action.c +src/dungeon_engine.c +src/code_80718D8.c +src/move_effects_target.c +src/code_8057824_1.c +src/code_8072B78.c +src/code_8044CC8.c +src/code_80861A8.c +src/dungeon_ai_leader.c +src/status_checks.c +src/weather.c +src/code_807CD9C.c +src/code_8069E0C.c +src/status_actions.c +src/code_80521D0.c +src/code_8045A00.c +src/dungeon_ai_items.c +src/dungeon_ai_targeting.c +src/code_8069D4C.c +src/code_8066D04.c +src/dungeon_leader.c +src/dungeon_map_access.c +src/tile_types.c +src/trap_1.c +src/code_8073CF0.c