diff --git a/include/move_orb_effects_3.h b/include/move_orb_effects_3.h index b4c70315d..c6b6d58e8 100644 --- a/include/move_orb_effects_3.h +++ b/include/move_orb_effects_3.h @@ -5,7 +5,7 @@ #include "structs/str_moves.h" void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move *move, const u8 *message); -void sub_8079764(Entity * pokemon); +void EndTwoTurnMove(Entity * pokemon); #endif diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index d2b9d6cdc..a78470261 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -83,7 +83,7 @@ typedef struct BurnClassStatus typedef struct FrozenClassStatus { /* 0x0 */ u8 status; - /* 0x4 */ s32 unk4; + /* 0x4 */ s32 constrictionAnimation; // Controls the animation that plays when taking damage from the constriction status. For some reason this is initalized to 0x22 (34)? /* 0x8 */ u8 turns; /* 0x9 */ u8 damageCountdown; } FrozenClassStatus; @@ -115,7 +115,7 @@ typedef struct CurseClassStatus { /* 0x0 */ u8 status; /* 0x1 */ bool8 applierNonTeamMemberFlag; // True if the Pokémon is a decoy and a wild Pokémon (i.e., not an allied Pokémon). - /* 0x2 */ bool8 unk2; + /* 0x2 */ bool8 unkDecoyTracker; // Set to 1 on a Pokemon when inflicted with the Decoy status. /* 0x3 */ u8 turns; /* 0x4 */ u8 damageCountdown; } CurseClassStatus; @@ -124,8 +124,8 @@ typedef struct CurseClassStatus typedef struct LeechSeedClassStatus { /* 0x0 */ u8 status; - /* 0x4 */ u32 unk4; - /* 0x8 */ u8 unk8; + /* 0x4 */ u32 applierID; // Used to track the statuses::statuses_unique_id of the relevant monster for statuses like Leech Seed and Destiny Bond. + /* 0x8 */ u8 monsterIndex; /* 0x9 */ u8 turns; /* 0xA */ u8 damageCountdown; } LeechSeedClassStatus; @@ -252,7 +252,7 @@ typedef struct EntityInfo /* 0xF0 */ bool8 powerEars; /* 0xF1 */ bool8 scanning; /* 0xF2 */ bool8 stairSpotter; - /* 0xF3 */ bool8 unkF3; + /* 0xF3 */ bool8 pickupFlag; // Set when initally spawning a team member with the ability Pickup. /* 0xF4 */ bool8 grudge; /* 0xF5 */ bool8 exposed; /* 0xF6 */ bool8 isColorChanged; @@ -266,7 +266,7 @@ typedef struct EntityInfo /* 0xFC */ bool8 useHeldItem; /* 0xFD */ u8 perishSongTurns; // When this reaches 0, the Pokémon faints from Perish Song. Doubles as a bool for whether the Pokémon is afflicted by Perish Song. u8 unkFE; - u8 unkFF; + u8 twoTurnMoveInvincible; /* 0x100 */ u8 decoyAITracker; // If the Pokémon is targeting a decoy, this indicates whether the decoy target is a team or wild Pokémon. /* 0x104 */ s32 speedStage; // The turn counter for movement speed up/down is split into five timers each. Multiple timers are used if the Pokémon is affected by multiple @@ -287,8 +287,8 @@ typedef struct EntityInfo /* 0x147 */ bool8 waiting; // True if an AI Pokémon decided to do nothing this turn. /* 0x148 */ bool8 attacking; /* 0x149 */ u8 unk149; - /* 0x14A */ u8 unk14A; - /* 0x14B */ u8 unk14B; + /* 0x14A */ bool8 usingChargedMove; // True if using a charged move. Changed together with bide status + /* 0x14B */ bool8 hitGrudgeMonster; /* 0x14C */ u8 unk14C; /* 0x14E */ u16 visualFlags; /* 0x150 */ u16 previousVisualFlags; @@ -340,7 +340,7 @@ typedef struct Entity // X = (posWorld * 24 + 16) * 256, while Y = (posWorld * 24 + 12) * 256. /* 0xC */ PixelPos pixelPos; /* 0x14 */ PixelPos prevPixelPos; - /* 0x1C */ s24_8 unk1C; + /* 0x1C */ s24_8 elevation; // Graphical parameter for elevation above the ground. /* 0x20 */ bool8 isVisible; // Turned off when a Pokémon faints. u8 unk21; u8 unk22; diff --git a/src/blow_away.c b/src/blow_away.c index 1a733e2ea..3655afd9a 100644 --- a/src/blow_away.c +++ b/src/blow_away.c @@ -173,7 +173,7 @@ void sub_807D068(Entity *pokemon, DungeonPos *pos) pixelY += incrementY; local_34.x = pixelX; local_34.y = pixelY; - pokemon->unk1C = sin_4096(iVar8) * 0xc; + pokemon->elevation = sin_4096(iVar8) * 0xc; UpdateEntityPixelPos(pokemon, &local_34); if (ShouldDisplayEntity(pokemon)) { DungeonRunFrameActions(0x1a); @@ -183,7 +183,7 @@ void sub_807D068(Entity *pokemon, DungeonPos *pos) } local_34.x = posX; local_34.y = posY; - pokemon->unk1C = IntToF248(0); + pokemon->elevation = IntToF248(0); UpdateEntityPixelPos(pokemon,&local_34); DungeonRunFrameActions(0x1a); } diff --git a/src/dungeon_8041AD0.c b/src/dungeon_8041AD0.c index d7469724e..2a42c42d6 100644 --- a/src/dungeon_8041AD0.c +++ b/src/dungeon_8041AD0.c @@ -196,7 +196,7 @@ static s32 sub_8041550(Entity *entity, s32 a1, u8 a2, u8 a3, s32 a4, u8 a5) entInfo = GetEntInfo(entity); if (!sub_8042768(entity)) return -1; - if (!a5 && entInfo->unkFF == 2) + if (!a5 && entInfo->twoTurnMoveInvincible == 2) return -1; if (a4 != 0) { @@ -1317,8 +1317,8 @@ void sub_80427AC(void) entity = gDungeon->activePokemon[i]; if (EntityIsValid(entity)) { enInfo = GetEntInfo(entity); - if (enInfo->unkF3) { - enInfo->unkF3 = FALSE; + if (enInfo->pickupFlag) { + enInfo->pickupFlag = FALSE; sub_80429A0(entity); if (!enInfo->isNotTeamMember) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); @@ -1509,11 +1509,11 @@ static void sub_8042A84(s16 param_1, Entity *entity, u32 param_3) sub_804151C(entity,param_1_s16,0); DungeonWaitFrames_Async(param_3,0x42); do { - if (entity->unk1C > IntToF248(199.999)) break; + if (entity->elevation > IntToF248(199.999)) break; DungeonRunFrameActions(0x42); - entity->unk1C += + r6; + entity->elevation += + r6; r6 += IntToF248(1); - iVar3 = (entity->pixelPos.y - entity->unk1C) / 256; + iVar3 = (entity->pixelPos.y - entity->elevation) / 256; } while (-8 <= iVar3 - gDungeon->unk181e8.cameraPixelPos.y); entity->isVisible = 0; sub_804178C_Async(FALSE); diff --git a/src/dungeon_action_execution.c b/src/dungeon_action_execution.c index c26e0ac4f..c388449d9 100644 --- a/src/dungeon_action_execution.c +++ b/src/dungeon_action_execution.c @@ -66,7 +66,7 @@ bool8 ExecuteEntityDungeonAction_Async(Entity *entity) gUnknown_203B434 = TRUE; info = GetEntInfo(entity); info->useHeldItem = FALSE; - info->unkF3 = FALSE; + info->pickupFlag = FALSE; gDungeon->unkB8 = entity; if (gUnknown_80F58F4[(info->action).action][0] != 0) { if (info->isTeamLeader) { @@ -77,7 +77,7 @@ bool8 ExecuteEntityDungeonAction_Async(Entity *entity) } } if (CannotAttack(entity, FALSE) && IsChargingAnyTwoTurnMove(entity, TRUE)) { - sub_8079764(entity); + EndTwoTurnMove(entity); } for(index = 0; index < MAX_MON_MOVES; index++) @@ -109,7 +109,7 @@ bool8 ExecuteEntityDungeonAction_Async(Entity *entity) info->attacking = TRUE; } bVar14 = FALSE; - info->unk14A = 0; + info->usingChargedMove = FALSE; gUnknown_202F221 = 0; gUnknown_202F222 = 0; switch(info->action.action) { @@ -264,16 +264,16 @@ bool8 ExecuteEntityDungeonAction_Async(Entity *entity) } sub_807FD84(entity); if (EntityIsValid(entity)) { - if (GetEntInfo(entity)->unk14A == 0) { - GetEntInfo(entity)->unk14A = 0; - sub_8079764(entity); + if (!GetEntInfo(entity)->usingChargedMove) { + GetEntInfo(entity)->usingChargedMove = FALSE; + EndTwoTurnMove(entity); } sub_8041888(0); if (EntityIsValid(entity)) { sub_8085140_Async(); - if (info->unk14B != 0) { + if (info->hitGrudgeMonster) { bVar4 = FALSE; - info->unk14B = 0; + info->hitGrudgeMonster = FALSE; for(index = 0; index < MAX_MON_MOVES; index++) { diff --git a/src/dungeon_damage.c b/src/dungeon_damage.c index 492bd7160..e8c2000a2 100644 --- a/src/dungeon_damage.c +++ b/src/dungeon_damage.c @@ -215,11 +215,11 @@ void HandleDealingDamage_Async(Entity *attacker, Entity *target, struct DamageSt if (r9) { EntityInfo *targetInfo = GetEntInfo(target); if (targetInfo->leechSeedClassStatus.status == STATUS_DESTINY_BOND) { - Entity *destBondTarget = gDungeon->activePokemon[targetInfo->leechSeedClassStatus.unk8]; + Entity *destBondTarget = gDungeon->activePokemon[targetInfo->leechSeedClassStatus.monsterIndex]; if (destBondTarget == NULL) { targetInfo->leechSeedClassStatus.status = 0; } - else if (GetEntInfo(destBondTarget)->dungeonSpriteId != targetInfo->leechSeedClassStatus.unk4) { + else if (GetEntInfo(destBondTarget)->dungeonSpriteId != targetInfo->leechSeedClassStatus.applierID) { targetInfo->leechSeedClassStatus.status = 0; } else { @@ -679,7 +679,7 @@ static bool8 HandleDealingDamageInternal_Async(Entity *attacker, Entity *target, SetMonSeenFlag(targetData->id); } if (targetData->grudge) { - attackerData->unk14B = 1; + attackerData->hitGrudgeMonster = TRUE; } if (giveExp == TRUE) { diff --git a/src/dungeon_items.c b/src/dungeon_items.c index 3e14e5132..148a1118c 100644 --- a/src/dungeon_items.c +++ b/src/dungeon_items.c @@ -388,7 +388,7 @@ bool8 sub_80462AC(Entity * entity, u8 hallucinating, u8 a2, u8 a3, u8 a4) } x = (entity->pixelPos.x / 256) - gDungeon->unk181e8.cameraPixelPos.x; - y = ((entity->pixelPos.y - entity->unk1C) / 256) - gDungeon->unk181e8.cameraPixelPos.y; + y = ((entity->pixelPos.y - entity->elevation) / 256) - gDungeon->unk181e8.cameraPixelPos.y; y2 = ((entity->pixelPos.y / 256) - gDungeon->unk181e8.cameraPixelPos.y) + 8; y2 /= 2; @@ -549,7 +549,7 @@ static void sub_8046734(Entity *entity, DungeonPos *pos) for (i = 0; i < 24; i++) { calcPixelPos.x += add.x; calcPixelPos.y += add.y; - entity->unk1C = sin_4096(sinVal) * 12; + entity->elevation = sin_4096(sinVal) * 12; UpdateEntityPixelPos(entity, &calcPixelPos); sub_80462AC(entity, hallucinating, 0, unk, 0); DungeonRunFrameActions(0x13); @@ -562,7 +562,7 @@ static void sub_8046734(Entity *entity, DungeonPos *pos) } SetEntityPixelPos(entity, posPixel.x, posPixel.y); - entity->unk1C = 0; + entity->elevation = 0; sub_80462AC(entity, hallucinating, 1, 0xFF, 0); DungeonRunFrameActions(0x13); } @@ -669,7 +669,7 @@ void sub_804687C(Entity *entity, DungeonPos *pos1, DungeonPos *pos2, Item *item, for (i = 0; i < count; i++) { if (EntityIsValid(&itemEntities[i])) { IncreaseEntityPixelPos(&itemEntities[i], itemVelocity[i].x, itemVelocity[i].y); - itemEntities[i].unk1C = sin_4096(sinVal) * 12; + itemEntities[i].elevation = sin_4096(sinVal) * 12; sub_80462AC(&itemEntities[i], hallucinating, 1, dirMaybe, 0); } } diff --git a/src/dungeon_leveling.c b/src/dungeon_leveling.c index 9d719922c..fa0d30b00 100644 --- a/src/dungeon_leveling.c +++ b/src/dungeon_leveling.c @@ -432,7 +432,7 @@ static bool8 LevelUp(Entity *pokemon, Entity *target, u8 param_3, u8 param_4) LoadIQSkills(target); - sub_8079764(target); + EndTwoTurnMove(target); info->atk[0] = sNewAtkStats[0]; info->atk[1] = sNewAtkStats[1]; @@ -526,7 +526,7 @@ static bool8 sub_80725A4(Entity *pokemon, Entity *target) LoadIQSkills(target); - sub_8079764(target); + EndTwoTurnMove(target); info->atk[0] = sNewAtkStats[0]; info->atk[1] = sNewAtkStats[1]; diff --git a/src/dungeon_mon_spawn.c b/src/dungeon_mon_spawn.c index 2be58a4af..4b4e37063 100644 --- a/src/dungeon_mon_spawn.c +++ b/src/dungeon_mon_spawn.c @@ -613,7 +613,7 @@ bool8 SpawnTeamMember(s16 _species, s32 x, s32 y, DungeonMon *monPtr, Entity **a entityInfo->maxBelly = monPtr->maxBelly; entityInfo->teamIndex = monPtr->unkC; entityInfo->heldItem = monPtr->itemSlot; - entityInfo->unkF3 = 0; + entityInfo->pickupFlag = FALSE; entityInfo->unk64 = 0; // Pickup Check @@ -625,7 +625,7 @@ bool8 SpawnTeamMember(s16 _species, s32 x, s32 y, DungeonMon *monPtr, Entity **a u32 pickUpItem = GetRandomFloorItem(0); if (pickUpItem != ITEM_POKE) { ItemIdToItem(&entityInfo->heldItem, pickUpItem, 0); - entityInfo->unkF3 = TRUE; + entityInfo->pickupFlag = TRUE; } } @@ -674,7 +674,7 @@ void UpdateEntitySpecies(Entity *entity, s32 _species) entity->axObj.unk43_animId2 = 0xFF; entity->axObj.unk45_orientation = 1; entity->axObj.unk47 = 1; - entity->unk1C = IntToF248(0); + entity->elevation = IntToF248(0); if (entInfo->frozenClassStatus.status == STATUS_WRAP || entInfo->frozenClassStatus.status == STATUS_WRAPPED) { sub_8076CB4(entInfo->unk9C); @@ -764,7 +764,7 @@ static void InitEntityFromSpawnInfo(bool8 a0, Entity *entity, struct MonSpawnInf entInfo->aiTarget.aiTarget = NULL; entInfo->aiTarget.unkC = 0; entInfo->aiTarget.aiTargetSpawnGenID = 0; - entInfo->unkFF = 0; + entInfo->twoTurnMoveInvincible = 0; entInfo->unk174 = 0; entInfo->decoyAITracker = 0; ResetMonEntityData(entInfo, TRUE); @@ -783,8 +783,8 @@ static void InitEntityFromSpawnInfo(bool8 a0, Entity *entity, struct MonSpawnInf entInfo->unk149 = FALSE; entInfo->abilityEffectFlags = 0; entInfo->terrifiedTurns = 0; - entInfo->useHeldItem = 0; - entInfo->unk14B = 0; + entInfo->useHeldItem = FALSE; + entInfo->hitGrudgeMonster = FALSE; entInfo->unk14C = 1; entInfo->visualFlags = 0; entInfo->previousVisualFlags = 0; @@ -830,7 +830,7 @@ void ResetMonEntityData(EntityInfo *entInfo, bool8 setStatsToOne) entInfo->frozenClassStatus.status = 0; entInfo->frozenClassStatus.turns = 0; entInfo->frozenClassStatus.damageCountdown = 0; - entInfo->frozenClassStatus.unk4 = 34; + entInfo->frozenClassStatus.constrictionAnimation = 34; entInfo->cringeClassStatus.status = 0; entInfo->cringeClassStatus.turns = 0; entInfo->bideClassStatus.status = 0; @@ -901,7 +901,7 @@ void ResetMonEntityData(EntityInfo *entInfo, bool8 setStatsToOne) entInfo->exposed = FALSE; entInfo->isColorChanged = 0; entInfo->bossFlag = 0; - entInfo->unkFF = 0; + entInfo->twoTurnMoveInvincible = 0; } void sub_806C1D8(void) diff --git a/src/dungeon_mon_sprite_render.c b/src/dungeon_mon_sprite_render.c index 342f8f086..ffca60be9 100644 --- a/src/dungeon_mon_sprite_render.c +++ b/src/dungeon_mon_sprite_render.c @@ -185,7 +185,7 @@ void UpdateMonsterSprite(Entity *entity) entity->prevPixelPos.y = entity->pixelPos.y; x = (entity->pixelPos.x / 256) - gDungeon->unk181e8.cameraPixelPos.x; - y = (((entity->pixelPos.y - entity->unk1C) - entInfo->unk174) / 256) - gDungeon->unk181e8.cameraPixelPos.y; + y = (((entity->pixelPos.y - entity->elevation) - entInfo->unk174) / 256) - gDungeon->unk181e8.cameraPixelPos.y; y2 = (entity->pixelPos.y / 256) - gDungeon->unk181e8.cameraPixelPos.y; y2 /= 2; if (entInfo->unk156 == 0) { @@ -208,7 +208,7 @@ void UpdateMonsterSprite(Entity *entity) } pos1.x = entity->pixelPos.x / 256; - pos1.y = ((entity->pixelPos.y - entity->unk1C) - entInfo->unk174) / 256; + pos1.y = ((entity->pixelPos.y - entity->elevation) - entInfo->unk174) / 256; sub_8005700(posArray, &entity->axObj.axdata); UpdateDungeonPokemonSprite2(entInfo->dungeonSpriteId, &pos1, posArray, gDungeon->unk181e8.priority); @@ -218,7 +218,7 @@ void UpdateMonsterSprite(Entity *entity) sub_8042EC8(entity, y2); if (entInfo->unk15C == 0) { - if (entInfo->unkFF == 1) { + if (entInfo->twoTurnMoveInvincible == 1) { if (entInfo->unk174 <= IntToF248(199.999)) { entInfo->unk174 += IntToF248(8); if (entInfo->unk174 > IntToF248(200)) { @@ -265,7 +265,7 @@ void UpdateMonsterSprite(Entity *entity) var_34 = 1; } - if (entInfo->unkFF != 2) { + if (entInfo->twoTurnMoveInvincible != 2) { s32 overworldPal; if (entInfo->frozenClassStatus.status == STATUS_PETRIFIED || entInfo->burnClassStatus.status == STATUS_PARALYSIS || entInfo->frozenClassStatus.status == STATUS_SHADOW_HOLD) { diff --git a/src/dungeon_monster_house.c b/src/dungeon_monster_house.c index 207f608e2..9be513f09 100644 --- a/src/dungeon_monster_house.c +++ b/src/dungeon_monster_house.c @@ -164,15 +164,15 @@ void TriggerMonsterHouse_Async(Entity *entity, bool8 forcedMonsterHouse) if (sub_806AA0C(spawnStruct.species, 1)) { Entity *newMonster = SpawnWildMon(&spawnStruct, FALSE); if (EntityIsValid(newMonster)) { - newMonster->unk1C = IntToF248(200); + newMonster->elevation = IntToF248(200); for (j = 0; j < 100; j++) { - newMonster->unk1C = s24_8_mul(newMonster->unk1C, IntToF248(0.665)); - if (newMonster->unk1C < IntToF248(1)) { + newMonster->elevation = s24_8_mul(newMonster->elevation, IntToF248(0.665)); + if (newMonster->elevation < IntToF248(1)) { break; } DungeonRunFrameActions(87); } - newMonster->unk1C = IntToF248(0); + newMonster->elevation = IntToF248(0); } } } diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 054901bee..32853b738 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -96,7 +96,7 @@ void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move, if (GetEntityType(snatchMon) == ENTITY_MONSTER && snatchMon != attacker && GetEntInfo(snatchMon)->dungeonSpriteId == gDungeon->unk17B3C - && targetInfo->unkFF == 0) + && targetInfo->twoTurnMoveInvincible == 0) { TryDisplayDungeonLoggableMessage3_Async(attacker, currTarget, gUnknown_80FCD28); // The move was snatched. currTarget = snatchMon; @@ -108,7 +108,7 @@ void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move, EntityInfo *lightRodInfo = GetEntInfo(lightRodMon); if (lightRodInfo->dungeonSpriteId == gDungeon->unk17B38 && GetTreatmentBetweenMonsters(lightRodMon, attacker, TRUE, FALSE) == 1 - && ((targetInfo->unkFF == 0 && lightRodInfo->unkFF == 0) || currTarget == lightRodMon)) + && ((targetInfo->twoTurnMoveInvincible == 0 && lightRodInfo->twoTurnMoveInvincible == 0) || currTarget == lightRodMon)) { sub_8042930(lightRodMon); TryDisplayDungeonLoggableMessage3_Async(attacker, currTarget, gUnknown_80FCD0C); // A Lightningrod took the move @@ -121,7 +121,7 @@ void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move, if (!CannotAttack(currTarget, FALSE) && (GetMoveTargetAndRangeForPokemon(attacker, move, FALSE) & 0xF0) == 0 && FixedPointToInt(targetInfo->belly) >= gPassScarfBellyDownValue - && targetInfo->unkFF == 0) + && targetInfo->twoTurnMoveInvincible == 0) { s32 direction1 = targetInfo->action.direction; s32 direction2 = targetInfo->action.direction; diff --git a/src/dungeon_move_util.c b/src/dungeon_move_util.c index b6a572284..1ceb39867 100644 --- a/src/dungeon_move_util.c +++ b/src/dungeon_move_util.c @@ -336,7 +336,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, BufferMoveName(gFormatBuffer_Items[0], move, NULL); if (MoveMatchesBideClassStatus(attacker, move)) { msg = gUnknown_80FC72C; // mon loosed move - GetEntInfo(attacker)->unkFF = 0; + GetEntInfo(attacker)->twoTurnMoveInvincible = 0; moveUsable = sub_805744C(attacker, move, TRUE); } else { @@ -409,7 +409,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, if (CannotAttack(attacker, FALSE)) break; } - entInfo->unk14A = 0; + entInfo->usingChargedMove = FALSE; if (move->id == MOVE_THRASH) { GetEntInfo(attacker)->action.direction = DungeonRandInt(NUM_DIRECTIONS); TargetTileInFront(attacker); @@ -447,9 +447,9 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, break; sub_806CF18(attacker); - if (GetEntInfo(attacker)->unk14A == 0) { - GetEntInfo(attacker)->unk14A = 0; // Redundant as it's already 0 - sub_8079764(attacker); + if (!GetEntInfo(attacker)->usingChargedMove) { + GetEntInfo(attacker)->usingChargedMove = FALSE; // Redundant as it's already 0 + EndTwoTurnMove(attacker); } } @@ -1146,14 +1146,14 @@ bool8 sub_80571F0(Entity * pokemon, Move *move) entityInfo = GetEntInfo(pokemon); - if (entityInfo->unkFF == 1) { + if (entityInfo->twoTurnMoveInvincible == 1) { moveID = move->id; if ((moveID == MOVE_SKY_UPPERCUT) || (moveID == MOVE_TWISTER) || (moveID == MOVE_GUST) || (moveID == MOVE_THUNDER)) return FALSE; else return TRUE; } - else if (entityInfo->unkFF == 2) { + else if (entityInfo->twoTurnMoveInvincible == 2) { if (entityInfo->bideClassStatus.status == STATUS_DIVING) { if (move->id == MOVE_WHIRLPOOL || move->id == MOVE_SURF) return FALSE; } diff --git a/src/dungeon_projectile_throw.c b/src/dungeon_projectile_throw.c index 2793e67dd..e05720887 100644 --- a/src/dungeon_projectile_throw.c +++ b/src/dungeon_projectile_throw.c @@ -50,7 +50,7 @@ void HandleStraightProjectileThrow(Entity *thrower, Item *item, DungeonPos *pos, projectile->isVisible = TRUE; projectile->unk22 = 0; projectile->axObj.info.item = item; - projectile->unk1C = 0; + projectile->elevation = 0; projectile->pos = *pos; SetEntityPixelPos(projectile, (pos->x * 24 + 4) << 8, (pos->y * 24 + 0) << 8); @@ -241,7 +241,7 @@ void HandleCurvedProjectileThrow(Entity *thrower, Item *item, DungeonPos *startP projectile->isVisible = TRUE; projectile->unk22 = 0; projectile->axObj.info.item = item; - projectile->unk1C = 0; + projectile->elevation = 0; projectile->pos = *startPos; SetEntityPixelPos(projectile, (startPos->x * 24 + 4) << 8, (startPos->y * 24 + 4) << 8); @@ -305,7 +305,7 @@ void HandleCurvedProjectileThrow(Entity *thrower, Item *item, DungeonPos *startP displayX = posXFixed + 0x400; displayY = posYFixed + 0x400; - projectile->unk1C = sinVal; + projectile->elevation = sinVal; unkX = (posXFixed / 256) + 8; unkY = (posYFixed / 256) + 16; sinePhase += sinePhaseStep; diff --git a/src/dungeon_serializer.c b/src/dungeon_serializer.c index 7df55f22e..ed5c3e0ac 100644 --- a/src/dungeon_serializer.c +++ b/src/dungeon_serializer.c @@ -339,7 +339,7 @@ static void WriteMonster(DataSerializer *seri, Entity *src) WriteBool8(seri, info->powerEars); WriteBool8(seri, info->scanning); WriteBool8(seri, info->stairSpotter); - WriteBool8(seri, info->unkF3); + WriteBool8(seri, info->pickupFlag); WriteBool8(seri, info->grudge); WriteU8(seri, info->expMultiplier); WriteBool8(seri, info->exposed); @@ -349,7 +349,7 @@ static void WriteMonster(DataSerializer *seri, Entity *src) WriteBool8(seri, info->useHeldItem); WriteU8(seri, info->perishSongTurns); WriteU8(seri, info->unkFE); - WriteMonsterUnkFF(seri, info->unkFF); + WriteMonsterUnkFF(seri, info->twoTurnMoveInvincible); WriteDecoyAITracker(seri, info->decoyAITracker); WriteSpeedStage(seri, info->speedStage); WriteSpeedCounters(seri, info->speedUpCounters, NUM_SPEED_COUNTERS); @@ -366,8 +366,8 @@ static void WriteMonster(DataSerializer *seri, Entity *src) WriteBool8(seri, info->bellyEmpty); WriteBool8(seri, info->attacking); WriteBool8(seri, info->unk149); - WriteBool8(seri, info->unk14A); - WriteBool8(seri, info->unk14B); + WriteBool8(seri, info->usingChargedMove); + WriteBool8(seri, info->hitGrudgeMonster); WriteBool8(seri, info->unk14C); WriteU16(seri, info->visualFlags); WriteU16(seri, info->previousVisualFlags); @@ -584,7 +584,7 @@ static void WriteFrozenClassStatus(DataSerializer *seri, FrozenClassStatus *src) WriteBytes(seri, &src->status, 1); WriteU8(seri, src->turns); WriteU8(seri, src->damageCountdown); - WriteU32(seri, src->unk4); + WriteU32(seri, src->constrictionAnimation); } static void WriteCringeClassStatus(DataSerializer *seri, CringeClassStatus *src) @@ -610,7 +610,7 @@ static void WriteCurseClassStatus(DataSerializer *seri, CurseClassStatus *src) { WriteBytes(seri, &src->status, 1); WriteBool8(seri, src->applierNonTeamMemberFlag); - WriteBool8(seri, src->unk2); + WriteBool8(seri, src->unkDecoyTracker); WriteU8(seri, src->turns); WriteU8(seri, src->damageCountdown); } @@ -618,8 +618,8 @@ static void WriteCurseClassStatus(DataSerializer *seri, CurseClassStatus *src) static void WriteLeechSeedClassStatus(DataSerializer *seri, LeechSeedClassStatus *src) { WriteBytes(seri, &src->status, 1); - WriteU32(seri, src->unk4); - WriteU8(seri, src->unk8); + WriteU32(seri, src->applierID); + WriteU8(seri, src->monsterIndex); WriteU8(seri, src->turns); WriteU8(seri, src->damageCountdown); } @@ -1027,7 +1027,7 @@ static void ReadMonster(DataSerializer *seri, bool8 isTeamMember, s32 index) entInfo.powerEars = ReadBool8(seri); entInfo.scanning = ReadBool8(seri); entInfo.stairSpotter = ReadBool8(seri); - entInfo.unkF3 = ReadBool8(seri); + entInfo.pickupFlag = ReadBool8(seri); entInfo.grudge = ReadBool8(seri); entInfo.expMultiplier = ReadU8(seri); entInfo.exposed = ReadBool8(seri); @@ -1037,7 +1037,7 @@ static void ReadMonster(DataSerializer *seri, bool8 isTeamMember, s32 index) entInfo.useHeldItem = ReadBool8(seri); entInfo.perishSongTurns = ReadU8(seri); entInfo.unkFE = ReadU8(seri); - entInfo.unkFF = ReadMonsterUnkFF(seri); + entInfo.twoTurnMoveInvincible = ReadMonsterUnkFF(seri); entInfo.decoyAITracker = ReadDecoyAITracker(seri); entInfo.speedStage = ReadSpeedStage(seri); @@ -1055,8 +1055,8 @@ static void ReadMonster(DataSerializer *seri, bool8 isTeamMember, s32 index) entInfo.bellyEmpty = ReadBool8(seri); entInfo.attacking = ReadBool8(seri); entInfo.unk149 = ReadBool8(seri); - entInfo.unk14A = ReadBool8(seri); - entInfo.unk14B = ReadBool8(seri); + entInfo.usingChargedMove = ReadBool8(seri); + entInfo.hitGrudgeMonster = ReadBool8(seri); entInfo.unk14C = ReadBool8(seri); entInfo.visualFlags = ReadU16(seri); entInfo.previousVisualFlags = ReadU16(seri); @@ -1156,7 +1156,7 @@ static Entity* sub_80828E0(s16 id, s16 apparentID, s32 index) entity->axObj.unk45_orientation = 1; entity->axObj.unk47 = 1; - entity->unk1C = IntToF248(0); + entity->elevation = IntToF248(0); sub_8045ACC(); entity->axObj.info.monster->unk167 = r4; entity->axObj.info.monster->unk168 = apparentBodySize; @@ -1212,7 +1212,7 @@ Entity* sub_8082A08(s32 _species, s32 _apparentSpecies, s32 index) entity->axObj.unk45_orientation = 1; entity->axObj.unk47 = 1; - entity->unk1C = IntToF248(0); + entity->elevation = IntToF248(0); entity->axObj.info.monster->unk167 = validId; entity->axObj.info.monster->unk168 = apparentBodySize; @@ -1380,7 +1380,7 @@ static void ReadFrozenClassStatus(DataSerializer *seri, FrozenClassStatus *dst) ReadBytes(seri, &dst->status, 1); dst->turns = ReadU8(seri); dst->damageCountdown = ReadU8(seri); - dst->unk4 = ReadU32(seri); + dst->constrictionAnimation = ReadU32(seri); } static void ReadCringeClassStatus(DataSerializer *seri, CringeClassStatus *dst) @@ -1406,7 +1406,7 @@ static void ReadCurseClassStatus(DataSerializer *seri, CurseClassStatus *dst) { ReadBytes(seri, &dst->status, 1); dst->applierNonTeamMemberFlag = ReadBool8(seri); - dst->unk2 = ReadBool8(seri); + dst->unkDecoyTracker = ReadBool8(seri); dst->turns = ReadU8(seri); dst->damageCountdown = ReadU8(seri); } @@ -1414,8 +1414,8 @@ static void ReadCurseClassStatus(DataSerializer *seri, CurseClassStatus *dst) static void ReadLeechSeedClassStatus(DataSerializer *seri, LeechSeedClassStatus *dst) { ReadBytes(seri, &dst->status, 1); - dst->unk4 = ReadU32(seri); - dst->unk8 = ReadU8(seri); + dst->applierID = ReadU32(seri); + dst->monsterIndex = ReadU8(seri); dst->turns = ReadU8(seri); dst->damageCountdown = ReadU8(seri); } diff --git a/src/dungeon_turn_effects.c b/src/dungeon_turn_effects.c index 1a210520c..5cbb76fe8 100644 --- a/src/dungeon_turn_effects.c +++ b/src/dungeon_turn_effects.c @@ -254,7 +254,7 @@ void DoEndOfTurnEffects_Async(Entity *entity) return; entityInfo->frozenClassStatus.damageCountdown = gConstrictionDmgCountdown; TrySendImmobilizeSleepEndMsg(entity, entity); - sub_8041C4C(entity, entityInfo->frozenClassStatus.unk4); + sub_8041C4C(entity, entityInfo->frozenClassStatus.constrictionAnimation); DealDamageToEntity_Async(entity, gConstrictionDmgValue, RESIDUAL_DAMAGE_CONSTRICT, DUNGEON_EXIT_FAINTED_FROM_CONSTRICTION); } if (!EntityIsValid(entity) || IsFloorOver()) @@ -302,7 +302,7 @@ void DoEndOfTurnEffects_Async(Entity *entity) if (entityInfo->leechSeedClassStatus.status == STATUS_LEECH_SEED) { if (entityInfo->leechSeedClassStatus.damageCountdown == 0 || --entityInfo->leechSeedClassStatus.damageCountdown == 0) { s32 hp = gLeechSeedHealValue; - Entity *target = gDungeon->activePokemon[entityInfo->leechSeedClassStatus.unk8]; + Entity *target = gDungeon->activePokemon[entityInfo->leechSeedClassStatus.monsterIndex]; entityInfo->leechSeedClassStatus.damageCountdown = gLeechSeedDmgCountdown; if (target == NULL) { @@ -310,7 +310,7 @@ void DoEndOfTurnEffects_Async(Entity *entity) } else { EntityInfo *targetInfo = GetEntInfo(target); - if (targetInfo->dungeonSpriteId != entityInfo->leechSeedClassStatus.unk4) { + if (targetInfo->dungeonSpriteId != entityInfo->leechSeedClassStatus.applierID) { entityInfo->leechSeedClassStatus.status = 0; } else { @@ -383,7 +383,7 @@ void DoEndOfTurnEffects_Async(Entity *entity) sub_80838EC(&entityInfo->bideClassStatus.turns); if (entityInfo->bideClassStatus.turns == 0) { entityInfo->bideClassStatus.status = 0; - entityInfo->unk14A = 0; + entityInfo->usingChargedMove = FALSE; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); LogMessageByIdWithPopupCheckUser_Async(entity, gUnknown_80FABD8); } diff --git a/src/dungeon_util.c b/src/dungeon_util.c index fcbe9497c..603115467 100644 --- a/src/dungeon_util.c +++ b/src/dungeon_util.c @@ -251,7 +251,7 @@ Entity *sub_80453AC(s32 _species) entity->axObj.unk45_orientation = 1; entity->axObj.unk47 = 1; - entity->unk1C = IntToF248(0); + entity->elevation = IntToF248(0); sub_8045ACC(); entity->axObj.info.monster->unk167 = validId; entity->axObj.info.monster->unk168 = bodySize; @@ -312,7 +312,7 @@ Entity *sub_804550C(s32 _species) entity->axObj.unk45_orientation = 1; entity->axObj.unk47 = 1; - entity->unk1C = IntToF248(0); + entity->elevation = IntToF248(0); entity->axObj.info.monster->unk167 = validId; entity->axObj.info.monster->unk168 = bodySize; @@ -346,7 +346,7 @@ Entity *SpawnTrap(u8 trapID, DungeonPos *pos, u8 c) entity->axObj.info.trap->id = trapID; entity->axObj.info.trap->unk1 = c; - entity->unk1C = IntToF248(0); + entity->elevation = IntToF248(0); entity->unk22 = 0; entity->pos = *pos; entity->spawnGenID = 0; @@ -377,7 +377,7 @@ Entity *SpawnItemEntity(DungeonPos *pos) SetEntityPixelPos(ent, ((pos->x * 24) + 4) * 0x100, ((pos->y * 24) + 4) * 0x100); ent->spawnGenID = 0; ent->unk22 = 0; - ent->unk1C = IntToF248(0); + ent->elevation = IntToF248(0); return ent; } } diff --git a/src/hurl_orb.c b/src/hurl_orb.c index 3b51bca90..28bc25354 100644 --- a/src/hurl_orb.c +++ b/src/hurl_orb.c @@ -168,7 +168,7 @@ void HandleHurlOrb(Entity *target, Entity *attacker) var_54.y += r10; UpdateEntityPixelPos(attacker, &var_54); if (ShouldDisplayEntity(attacker)) { - attacker->unk1C = sin_4096(var_2C) << 5; + attacker->elevation = sin_4096(var_2C) << 5; DungeonRunFrameActions(0x3B); if (!(i & 3)) { attackerDirection &= DIRECTION_MASK; @@ -181,7 +181,7 @@ void HandleHurlOrb(Entity *target, Entity *attacker) var_54.x = pixelPosX; var_54.y = pixelPosY; - attacker->unk1C = 0; + attacker->elevation = 0; UpdateEntityPixelPos(attacker, &var_54); DungeonRunFrameActions(0x3B); GetEntInfo(attacker)->action.direction = attackerDirection & DIRECTION_MASK; diff --git a/src/move_orb_actions_1.c b/src/move_orb_actions_1.c index 133fdd884..43d297aef 100644 --- a/src/move_orb_actions_1.c +++ b/src/move_orb_actions_1.c @@ -117,7 +117,7 @@ bool8 DigMoveAction(Entity * pokemon, Entity * target, Move *move, s32 itemId) else { if (MoveMatchesBideClassStatus(pokemon,move)) { HandleDamagingMove(pokemon,target,move,gDigModifier,itemId); - sub_8079764(pokemon); + EndTwoTurnMove(pokemon); } else { SetChargeStatusTarget(pokemon,pokemon,STATUS_DIGGING,move,gUnknown_80FAD4C); // $m0 burrowed underground! @@ -640,7 +640,7 @@ bool8 RazorWindMoveAction(Entity * pokemon, Entity * target, Move * move, s32 it if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gRazorWindModifier,itemId) ? TRUE : FALSE; - sub_8079764(pokemon); + EndTwoTurnMove(pokemon); } else { SetChargeStatusTarget(pokemon,pokemon,STATUS_RAZOR_WIND,move,gUnknown_80FAC54); @@ -800,7 +800,7 @@ bool8 FocusPunchMoveAction(Entity * pokemon, Entity * target, Move * move, s32 i if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gFocusPunchModifier,itemId) ? TRUE : FALSE; - sub_8079764(pokemon); + EndTwoTurnMove(pokemon); } else { SetChargeStatusTarget(pokemon,pokemon,STATUS_FOCUS_PUNCH,move,gUnknown_80FACA4); diff --git a/src/move_orb_actions_2.c b/src/move_orb_actions_2.c index 97cd7a883..0b60cfaf7 100644 --- a/src/move_orb_actions_2.c +++ b/src/move_orb_actions_2.c @@ -50,7 +50,7 @@ bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemI if(sub_805727C(pokemon, target, gSkyAttackSecondaryChance)) TryInflictCringeStatus(pokemon, target, FALSE); } - sub_8079764(pokemon); + EndTwoTurnMove(pokemon); } else { SetChargeStatusTarget(pokemon, pokemon, STATUS_SKY_ATTACK, move, gUnknown_80FACC4); @@ -605,7 +605,7 @@ bool8 SolarBeamMoveAction(Entity * pokemon,Entity * target,Move * move,s32 itemI modifier /= 2; } weather = HandleDamagingMove(pokemon,target,move,modifier,itemId) != 0 ? TRUE : FALSE; - sub_8079764(pokemon); + EndTwoTurnMove(pokemon); } else { SetChargeStatusTarget(pokemon,pokemon,STATUS_SOLARBEAM,move,gUnknown_80FACE4); @@ -631,7 +631,7 @@ bool8 FlyMoveAction(Entity * pokemon, Entity * target, Move * move, s32 itemId) flag = FALSE; if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gFlyModifier,itemId) != 0 ? TRUE : FALSE; - sub_8079764(pokemon); + EndTwoTurnMove(pokemon); } else { SetChargeStatusTarget(pokemon,pokemon,STATUS_FLYING,move,gUnknown_80FACFC); @@ -656,7 +656,7 @@ bool8 DiveMoveAction(Entity * pokemon, Entity * target, Move * move, s32 itemId) } else if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gDiveModifier,itemId) != 0 ? TRUE : FALSE; - sub_8079764(pokemon); + EndTwoTurnMove(pokemon); } else { SetChargeStatusTarget(pokemon,pokemon,STATUS_DIVING,move,gUnknown_80FAD2C); diff --git a/src/move_orb_actions_3.c b/src/move_orb_actions_3.c index 92467e230..2f69ab182 100644 --- a/src/move_orb_actions_3.c +++ b/src/move_orb_actions_3.c @@ -107,7 +107,7 @@ bool8 BounceMoveAction(Entity * pokemon,Entity * target,Move * move,s32 itemId) TryInflictParalysisStatus(pokemon, target, FALSE); } } - sub_8079764(pokemon); + EndTwoTurnMove(pokemon); } else { SetChargeStatusTarget(pokemon, pokemon, STATUS_BOUNCING, move, gUnknown_80FAD10); diff --git a/src/move_orb_actions_4.c b/src/move_orb_actions_4.c index 52c808cd4..765d030ce 100644 --- a/src/move_orb_actions_4.c +++ b/src/move_orb_actions_4.c @@ -316,7 +316,7 @@ bool8 SkullBashMoveAction(Entity * pokemon, Entity * target, Move * move, s32 it if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gSkullBashModifier,itemId) != 0 ? 1 : 0; - sub_8079764(pokemon); + EndTwoTurnMove(pokemon); } else { SetChargeStatusTarget(pokemon,target,STATUS_SKULL_BASH,move,gUnknown_80FAFF0); diff --git a/src/move_orb_effects_1.c b/src/move_orb_effects_1.c index 3ea05c97b..713e3a413 100644 --- a/src/move_orb_effects_1.c +++ b/src/move_orb_effects_1.c @@ -663,7 +663,7 @@ void SqueezedStatusTarget(Entity * pokemon, Entity * target, s32 param_3, bool32 entityInfo->frozenClassStatus.status = STATUS_CONSTRICTION; entityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gConstrictionTurnRange,TRUE) + 1; entityInfo->frozenClassStatus.damageCountdown = 0; - entityInfo->frozenClassStatus.unk4 = param_3_s32; + entityInfo->frozenClassStatus.constrictionAnimation = param_3_s32; nullsub_71(target); TryDisplayDungeonLoggableMessage3_Async(pokemon,target,gUnknown_80FB628); sub_806CE94(target,8); diff --git a/src/move_orb_effects_2.c b/src/move_orb_effects_2.c index d76d3d79c..b864a98de 100644 --- a/src/move_orb_effects_2.c +++ b/src/move_orb_effects_2.c @@ -269,7 +269,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) entityInfo->leechSeedClassStatus.turns = CalculateStatusTurns(target, gLeechSeedTurnRange, TRUE) + 1; entityInfo->leechSeedClassStatus.damageCountdown = 0; nullsub_78(target); - entityInfo->leechSeedClassStatus.unk8 = 0xff; + entityInfo->leechSeedClassStatus.monsterIndex = 0xff; break; case STATUS_LEECH_SEED: TryDisplayDungeonLoggableMessage3_Async(pokemon,target,gUnknown_80FAE7C); @@ -278,9 +278,9 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { if (pokemon == gDungeon->activePokemon[index]) { - entityInfo->leechSeedClassStatus.unk8 = index; + entityInfo->leechSeedClassStatus.monsterIndex = index; entityInfo2 = GetEntInfo(pokemon); - entityInfo->leechSeedClassStatus.unk4 = entityInfo2->dungeonSpriteId; + entityInfo->leechSeedClassStatus.applierID = entityInfo2->dungeonSpriteId; } } TryDisplayDungeonLoggableMessage3_Async(pokemon,target,gUnknown_80FAE58); @@ -305,7 +305,7 @@ void sub_8078084(Entity * pokemon) entityInfo2 = GetEntInfo(target); if(entityInfo2->leechSeedClassStatus.status == STATUS_LEECH_SEED || entityInfo2->leechSeedClassStatus.status == STATUS_DESTINY_BOND) { - if(entityInfo2->leechSeedClassStatus.unk4 == entityInfo->dungeonSpriteId) + if(entityInfo2->leechSeedClassStatus.applierID == entityInfo->dungeonSpriteId) { entityInfo2->leechSeedClassStatus.status = STATUS_NONE; UpdateStatusIconFlags(target); @@ -334,7 +334,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) entityInfo->leechSeedClassStatus.turns = CalculateStatusTurns(target,gDestinyBondTurnRange,TRUE) + 1; entityInfo->leechSeedClassStatus.damageCountdown = 0; nullsub_74(target); - entityInfo->leechSeedClassStatus.unk8 = 0xff; + entityInfo->leechSeedClassStatus.monsterIndex = 0xff; } else { @@ -344,9 +344,9 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { if (target == gDungeon->activePokemon[index]) { - entityInfo->leechSeedClassStatus.unk8 = index; + entityInfo->leechSeedClassStatus.monsterIndex = index; entityInfo2 = GetEntInfo(target); - entityInfo->leechSeedClassStatus.unk4 = entityInfo2->dungeonSpriteId; + entityInfo->leechSeedClassStatus.applierID = entityInfo2->dungeonSpriteId; } } TryDisplayDungeonLoggableMessage3_Async(pokemon,target,gUnknown_80FBB4C); @@ -466,7 +466,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, bool8 param_3) } targetEntityInfo->curseClassStatus.status = STATUS_DECOY; targetEntityInfo->curseClassStatus.applierNonTeamMemberFlag = GetEntInfo(pokemon)->isNotTeamMember; - targetEntityInfo->curseClassStatus.unk2 = param_3; + targetEntityInfo->curseClassStatus.unkDecoyTracker = param_3; targetEntityInfo->curseClassStatus.turns = CalculateStatusTurns(target,gDecoyTurnRange,TRUE) + 1; targetEntityInfo->curseClassStatus.damageCountdown = 0; sub_806CCB4(target,sub_806CEBC(target)); diff --git a/src/move_orb_effects_3.c b/src/move_orb_effects_3.c index ab096a897..0adaf976d 100644 --- a/src/move_orb_effects_3.c +++ b/src/move_orb_effects_3.c @@ -56,15 +56,15 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * break; } } - entityInfo->unk14A = 1; + entityInfo->usingChargedMove = TRUE; uVar5 = FALSE; if (newStatus == STATUS_FLYING || newStatus == STATUS_BOUNCING) { - entityInfo->unkFF = 1; + entityInfo->twoTurnMoveInvincible = 1; uVar5 = TRUE; } else if (newStatus == STATUS_DIVING || newStatus == STATUS_DIGGING) { - entityInfo->unkFF = 2; + entityInfo->twoTurnMoveInvincible = 2; } if (newStatus == STATUS_BIDE) { entityInfo->bideClassStatus.turns = CalculateStatusTurns(target,gBideTurnRange, FALSE) + 1; @@ -80,7 +80,7 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * // TODO: this could probably be cleaner.. for (index = 0, iVar8 = 0xc7ff; index < 400; index++) { bVar2 = TRUE; - if (entityInfo->unkFF == 1) + if (entityInfo->twoTurnMoveInvincible == 1) if(iVar7 = entityInfo->unk174, bVar2 = FALSE, iVar7 > iVar8) // unk174 -> u32 to s32 { bVar2 = TRUE; @@ -94,7 +94,7 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * } } -void sub_8079764(Entity * pokemon) +void EndTwoTurnMove(Entity * pokemon) { EntityInfo *entityInfo; @@ -102,8 +102,8 @@ void sub_8079764(Entity * pokemon) entityInfo = GetEntInfo(pokemon); if ((entityInfo->bideClassStatus.status != STATUS_BIDE) && (entityInfo->bideClassStatus.status != STATUS_ENRAGED)) { entityInfo->bideClassStatus.status = STATUS_NONE; - entityInfo->unk14A = 0; - entityInfo->unkFF = 0; + entityInfo->usingChargedMove = FALSE; + entityInfo->twoTurnMoveInvincible = 0; } UpdateStatusIconFlags(pokemon); } diff --git a/src/move_orb_effects_5.c b/src/move_orb_effects_5.c index a9df558cc..30353b163 100644 --- a/src/move_orb_effects_5.c +++ b/src/move_orb_effects_5.c @@ -412,7 +412,7 @@ void EndLeechSeedClassStatus(Entity * pokemon, Entity * target) break; } entityInfo->leechSeedClassStatus.status = STATUS_NONE; - entityInfo->leechSeedClassStatus.unk8 = 0xff; + entityInfo->leechSeedClassStatus.monsterIndex = 0xff; UpdateStatusIconFlags(target); } } diff --git a/src/status_checks.c b/src/status_checks.c index 39035d91c..db13c87fe 100644 --- a/src/status_checks.c +++ b/src/status_checks.c @@ -174,7 +174,7 @@ bool8 sub_80701A4(Entity *pokemon) } } } - sub_8079764(pokemon); + EndTwoTurnMove(pokemon); } return FALSE; } diff --git a/src/trawl_orb.c b/src/trawl_orb.c index e8715efa6..4c5a6849f 100644 --- a/src/trawl_orb.c +++ b/src/trawl_orb.c @@ -60,7 +60,7 @@ void HandleTrawlOrb(Entity *user, Entity *target) currItemEntity->spawnGenID = 0; currItemEntity->isVisible = TRUE; currItemEntity->unk22 = 0; - currItemEntity->unk1C = IntToF248(0); + currItemEntity->elevation = IntToF248(0); itemInfo[itemsCount] = gDungeon->unk3804[i]; currItemEntity++; itemsCount++; @@ -132,7 +132,7 @@ void HandleTrawlOrb(Entity *user, Entity *target) for (i = 0; i < itemsCount; i++) { if (EntityIsValid(&itemEntities[i])) { IncreaseEntityPixelPos(&itemEntities[i], itemVelocity[i].x, itemVelocity[i].y); - itemEntities[i].unk1C = sin_4096(unkAngle) * 0xC; + itemEntities[i].elevation = sin_4096(unkAngle) * 0xC; sub_80462AC(&itemEntities[i], hallucinating, 0, var, 0); } } diff --git a/src/warp_target.c b/src/warp_target.c index a70b7653f..68e31c35a 100644 --- a/src/warp_target.c +++ b/src/warp_target.c @@ -64,15 +64,15 @@ void WarpTarget(Entity *pokemon, Entity *target, u32 param_3, DungeonPos *pos) sub_80421AC(pokemon,target); if (ShouldDisplayEntity(target)) { direction = (info->action).direction; - target->unk1C += + 0x800; - while ( target->unk1C < 0xa000) { + target->elevation += + 0x800; + while ( target->elevation < 0xa000) { if ((gDungeonFramesCounter & 3) == 0) { direction = (direction + 1) & DIRECTION_MASK; info->action.direction = direction & DIRECTION_MASK; sub_806CE68(target,direction); } DungeonRunFrameActions(0x22); - target->unk1C += 0x800; + target->elevation += 0x800; } } @@ -110,7 +110,7 @@ void WarpTarget(Entity *pokemon, Entity *target, u32 param_3, DungeonPos *pos) UpdateCamera(1); if (ShouldDisplayEntity(target)) { direction = (info->action).direction; - target->unk1C = 0x9c00; + target->elevation = 0x9c00; do { if ((gDungeonFramesCounter & 3) == 0) { direction = (direction + 1) & DIRECTION_MASK; @@ -118,10 +118,10 @@ void WarpTarget(Entity *pokemon, Entity *target, u32 param_3, DungeonPos *pos) sub_806CE68(target,direction); } DungeonRunFrameActions(0x22); - target->unk1C -= 0x400; - } while (0 < target->unk1C); + target->elevation -= 0x400; + } while (0 < target->elevation); } - target->unk1C = IntToF248(0); + target->elevation = IntToF248(0); DungeonRunFrameActions(0x22); if (flag) { TryDisplayDungeonLoggableMessage3_Async(pokemon,target,gUnknown_80FCB14); // But it dropped back at the same spot!