From 8237e29a164211eb2ec4cd161eb4183cc1947fee Mon Sep 17 00:00:00 2001 From: Cheng Hann Gan Date: Thu, 9 Sep 2021 19:22:48 -0400 Subject: Defined more in-dungeon structs and enums (#53) * Defined DungeonEntity * Rename EntityType enums * Revert EntityType rename * Defined more in-dungeon structs and enums * Added more dungeon global structs/enums * Prefixed dungeonGlobalData with g * Fixed compile errors * Removed some CRLFs * Fixed compile after merge * Revert Makefile * Rename DungeonEntityData.entityType Co-authored-by: Seth Barberee * Renamed symbols per PR comments Co-authored-by: Cheng Hann Gan Co-authored-by: Seth Barberee --- src/code_8086A3C.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/code_8086A3C.c') diff --git a/src/code_8086A3C.c b/src/code_8086A3C.c index d740ccd..63c2d44 100644 --- a/src/code_8086A3C.c +++ b/src/code_8086A3C.c @@ -1,9 +1,9 @@ #include "global.h" #include "dungeon_entity.h" -#include "gUnknown_203B418.h" +#include "dungeon_global_data.h" #include "pokemon.h" -extern struct unkStruct_203B418 *gUnknown_203B418; +extern struct DungeonGlobalData *gDungeonGlobalData; extern void sub_807191C(struct DungeonEntity *); extern struct DungeonEntity *sub_8085480(void); extern struct DungeonEntity *sub_8085680(u32); @@ -23,47 +23,47 @@ extern void sub_8097FA8(u32); void sub_8086A3C(struct DungeonEntity *param_1) { - param_1->unk70->unk15C = 1; - param_1->unk70->unk15E = 1; + param_1->entityData->unk15C = 1; + param_1->entityData->unk15E = 1; } void sub_8086A54(struct DungeonEntity *param_1) { - param_1->unk70->unk15C = 1; - param_1->unk70->unk15E = 0; + param_1->entityData->unk15C = 1; + param_1->entityData->unk15E = 0; } void SetupBossFightHP(struct DungeonEntity *param_1, s32 newHP, u16 param_3) { // NOTE: needed two of these to match.. very dumb - struct subStruct_8048524 *iVar1; - struct subStruct_8048524 *iVar2; - - iVar1 = param_1->unk70; - iVar2 = param_1->unk70; - + struct DungeonEntityData *iVar1; + struct DungeonEntityData *iVar2; + + iVar1 = param_1->entityData; + iVar2 = param_1->entityData; + iVar1->isBoss = TRUE; // BUG: Source of the Reviver Seed Boss Glitch // // Video to demonstration: // https://www.youtube.com/watch?v=rHu7EehrZ68 - iVar1->bossHPBackup = iVar1->maxHP; + iVar1->originalHP = iVar1->maxHP; if (newHP != 0) { iVar1->maxHP = newHP; iVar1->HP = newHP; } - gUnknown_203B418->unk66A = param_3; - sub_808EC94(iVar2->unk8C,iVar2->isBoss); + gDungeonGlobalData->unk66A = param_3; + sub_808EC94(iVar2->IQSkillsSelected,iVar2->isBoss); sub_807191C(param_1); } void sub_8086AC0(void) { if(!sub_8044B28()) - if(gUnknown_203B418->unk2 == 0) + if(gDungeonGlobalData->unk2 == 0) sub_8097FF8(); } @@ -71,7 +71,7 @@ u8 sub_8086AE4(s16 _index) { s32 pokeIndex = _index; - if(gUnknown_203B418->unk65C == 0) + if(gDungeonGlobalData->unk65C == 0) return 1; else return HasRecruitedMon(pokeIndex); @@ -82,7 +82,7 @@ void sub_8086B14(void) struct DungeonEntity * iVar1; struct DungeonEntity * iVar2; struct DungeonEntity * uVar3; - + iVar1 = sub_8085480(); iVar2 = sub_8085680(4); uVar3 = sub_8085680(3); @@ -92,7 +92,7 @@ void sub_8086B14(void) sub_8085930(4); sub_80855E4(sub_8086A3C); sub_8086A3C(uVar3); - iVar2->unk70->unk15C = 1; + iVar2->entityData->unk15C = 1; sub_8085860(iVar1->posWorldX,iVar1->posWorldY + -2); CopySpeciesNametoBuffer(gUnknown_202E038,SPECIES_DIGLETT); CopySpeciesNametoBuffer(gUnknown_202E038 + 0x50, SPECIES_SKARMORY); @@ -103,7 +103,7 @@ void sub_8086B94(void) struct DungeonEntity * iVar1; struct DungeonEntity * iVar2; struct DungeonEntity * uVar3; - + iVar1 = sub_8085480(); iVar2 = sub_8085680(4); uVar3 = sub_8085680(3); @@ -119,6 +119,6 @@ void sub_8086BDC(char param_1, s32 param_2) { if ((((param_2 * 0x1000000) - 0x1000000U) >> 0x18 < 2) && (param_1 == 3)) { sub_8097FA8(1); - gUnknown_203B418->unk2 = 1; + gDungeonGlobalData->unk2 = 1; } } -- cgit v1.2.3