diff --git a/include/dungeon_action.h b/include/dungeon_action.h index 3fdd48e82..bb95fe087 100644 --- a/include/dungeon_action.h +++ b/include/dungeon_action.h @@ -3,8 +3,8 @@ #include "dungeon_entity.h" -void ClearMonsterActionFields(struct DungeonActionContainer *actionPointer); -void SetMonsterActionFields(struct DungeonActionContainer *actionPointer, u16 action); -void SetActionPassTurnOrWalk(struct DungeonActionContainer *actionPointer, s16 species); +void ClearMonsterActionFields(struct ActionContainer *actionPointer); +void SetMonsterActionFields(struct ActionContainer *actionPointer, u16 action); +void SetActionPassTurnOrWalk(struct ActionContainer *actionPointer, s16 species); #endif diff --git a/include/dungeon_entity.h b/include/dungeon_entity.h index 376c60aca..158f36d45 100644 --- a/include/dungeon_entity.h +++ b/include/dungeon_entity.h @@ -12,7 +12,7 @@ #define DEFAULT_STAT_MULTIPLIER 256 #define MAX_SPEED_STAGE 4 #define MAX_STOCKPILE_STAGE 3 -#define NUM_SPEED_TURN_COUNTERS 5 +#define NUM_SPEED_COUNTERS 5 #define NUM_PREV_POS 4 #define STAT_STAGE_ATK 0 @@ -22,7 +22,7 @@ #define STAT_STAGE_ACCURACY 0 #define STAT_STAGE_EVASION 1 -struct DungeonActionContainer +struct ActionContainer { /* 0x0 */ u16 action; /* 0x2 */ u8 direction; @@ -82,7 +82,7 @@ struct EntityInfo /* 0x3E */ u8 hiddenPowerType; u8 fill3F; /* 0x40 */ u8 joinedAt; // Uses the dungeon index in dungeon.h. - /* 0x44 */ struct DungeonActionContainer action; + /* 0x44 */ struct ActionContainer action; /* 0x5C */ u8 types[2]; /* 0x5E */ u8 abilities[2]; /* 0x60 */ struct Item heldItem; @@ -181,8 +181,8 @@ struct EntityInfo /* 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 // speed-up/slow effects at once, like using Agility twice. - /* 0x108 */ u8 speedUpCounters[NUM_SPEED_TURN_COUNTERS]; - /* 0x10D */ u8 speedDownCounters[NUM_SPEED_TURN_COUNTERS]; + /* 0x108 */ u8 speedUpCounters[NUM_SPEED_COUNTERS]; + /* 0x10D */ u8 speedDownCounters[NUM_SPEED_COUNTERS]; /* 0x112 */ u8 stockpileStage; u8 fill113; // When non-zero, an AI Pokémon will move in a random direction every turn. diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index 6fa16f5a4..fe48d59f9 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -1108,7 +1108,7 @@ void sub_8079F20(struct Entity * pokemon, struct Entity * target, u8 param_3, u8 } moveSpeed = GetSpeedStatus(target); - for(index = 0; index < NUM_SPEED_TURN_COUNTERS; index++) + for(index = 0; index < NUM_SPEED_COUNTERS; index++) { entityData->speedDownCounters[index] = 0; } diff --git a/src/dungeon_action.c b/src/dungeon_action.c index 3001b4b5f..57085ae46 100644 --- a/src/dungeon_action.c +++ b/src/dungeon_action.c @@ -246,21 +246,21 @@ void sub_8044C50(u16 action) entityData->action.itemTargetPosition.y = -1; } -void ClearMonsterActionFields(struct DungeonActionContainer *actionPointer) +void ClearMonsterActionFields(struct ActionContainer *actionPointer) { actionPointer->action = ACTION_NOTHING; actionPointer->actionUseIndex = 0; actionPointer->unkC = 0; } -void SetMonsterActionFields(struct DungeonActionContainer *actionPointer, u16 action) +void SetMonsterActionFields(struct ActionContainer *actionPointer, u16 action) { actionPointer->action = action; actionPointer->actionUseIndex = 0; actionPointer->unkC = 0; } -void SetActionPassTurnOrWalk(struct DungeonActionContainer *actionPointer, s16 species) +void SetActionPassTurnOrWalk(struct ActionContainer *actionPointer, s16 species) { if (CanMove(species)) { diff --git a/src/status.c b/src/status.c index f92c1b525..84a6bf440 100644 --- a/src/status.c +++ b/src/status.c @@ -495,7 +495,7 @@ void RaiseMovementSpeedTarget(struct Entity * pokemon, struct Entity * target, s sub_80522F4(pokemon,target,*gUnknown_80FC2B8); } else { - for(index = 0; index < NUM_SPEED_TURN_COUNTERS; index++) + for(index = 0; index < NUM_SPEED_COUNTERS; index++) { if(entityData->speedUpCounters[index] == 0) { @@ -542,7 +542,7 @@ void LowerMovementSpeedTarget(struct Entity * pokemon, struct Entity * target, s else { for(counter = 0; counter < levels; counter++) { - for(index = 0; index < NUM_SPEED_TURN_COUNTERS; index++) + for(index = 0; index < NUM_SPEED_COUNTERS; index++) { if (entityData->speedDownCounters[index]== 0) { entityData->speedDownCounters[index] = CalculateStatusTurns(target,gUnknown_80F4E48,TRUE) + 1; @@ -975,7 +975,7 @@ void sub_80783C4(struct Entity * pokemon, struct Entity * target, u8 param_3) struct EntityInfo *entityData; struct Entity * entity; struct Entity * entity2; - struct DungeonActionContainer action; + struct ActionContainer action; s32 index; if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { diff --git a/src/status_checks_1.c b/src/status_checks_1.c index d4bfaa167..0faa02cd5 100644 --- a/src/status_checks_1.c +++ b/src/status_checks_1.c @@ -114,9 +114,9 @@ s32 GetSpeedStatus(struct Entity *pokemon) entityData = pokemon->info; speed = 0; - for(index = 0; index < NUM_SPEED_TURN_COUNTERS; index++) + for(index = 0; index < NUM_SPEED_COUNTERS; index++) { - if (entityData->speedUpCounters[index + NUM_SPEED_TURN_COUNTERS] != 0) { + if (entityData->speedUpCounters[index + NUM_SPEED_COUNTERS] != 0) { speed--; } if (entityData->speedUpCounters[index] != 0) { @@ -278,7 +278,7 @@ bool8 HasNegativeStatus(struct Entity *pokemon) return TRUE; } } - for (i = 0; i < NUM_SPEED_TURN_COUNTERS; i++) + for (i = 0; i < NUM_SPEED_COUNTERS; i++) { if (pokemonInfo->speedDownCounters[i] != 0) {