use ability num instead of alt ability

This commit is contained in:
DizzyEggg 2019-05-14 15:22:16 +02:00 committed by huderlem
parent 2fdc489bc0
commit 33979f0fa6
24 changed files with 571 additions and 571 deletions

View File

@ -240,7 +240,7 @@ struct BattleTowerPokemon
u32 spAttackIV:5; u32 spAttackIV:5;
u32 spDefenseIV:5; u32 spDefenseIV:5;
u32 gap:1; u32 gap:1;
u32 altAbility:1; u32 abilityNum:1;
u32 personality; u32 personality;
u8 nickname[POKEMON_NAME_LENGTH + 1]; u8 nickname[POKEMON_NAME_LENGTH + 1];
u8 friendship; u8 friendship;
@ -287,7 +287,7 @@ struct RentalMon
u16 monId; u16 monId;
u32 personality; u32 personality;
u8 ivs; u8 ivs;
u8 abilityBit; u8 abilityNum;
}; };
struct BattleDomeTrainer struct BattleDomeTrainer

View File

@ -50,7 +50,7 @@
#define MON_DATA_SPATK_IV 43 #define MON_DATA_SPATK_IV 43
#define MON_DATA_SPDEF_IV 44 #define MON_DATA_SPDEF_IV 44
#define MON_DATA_IS_EGG 45 #define MON_DATA_IS_EGG 45
#define MON_DATA_ALT_ABILITY 46 #define MON_DATA_ABILITY_NUM 46
#define MON_DATA_TOUGH 47 #define MON_DATA_TOUGH 47
#define MON_DATA_SHEEN 48 #define MON_DATA_SHEEN 48
#define MON_DATA_OT_GENDER 49 #define MON_DATA_OT_GENDER 49
@ -182,7 +182,7 @@ struct PokemonSubstruct3
/* 0x05 */ u32 spAttackIV:5; /* 0x05 */ u32 spAttackIV:5;
/* 0x06 */ u32 spDefenseIV:5; /* 0x06 */ u32 spDefenseIV:5;
/* 0x07 */ u32 isEgg:1; /* 0x07 */ u32 isEgg:1;
/* 0x07 */ u32 altAbility:1; /* 0x07 */ u32 abilityNum:1;
/* 0x08 */ u32 coolRibbon:3; /* 0x08 */ u32 coolRibbon:3;
/* 0x08 */ u32 beautyRibbon:3; /* 0x08 */ u32 beautyRibbon:3;
@ -281,7 +281,7 @@ struct BattlePokemon
/*0x16*/ u32 spAttackIV:5; /*0x16*/ u32 spAttackIV:5;
/*0x17*/ u32 spDefenseIV:5; /*0x17*/ u32 spDefenseIV:5;
/*0x17*/ u32 isEgg:1; /*0x17*/ u32 isEgg:1;
/*0x17*/ u32 altAbility:1; /*0x17*/ u32 abilityNum:1;
/*0x18*/ s8 statStages[NUM_BATTLE_STATS]; /*0x18*/ s8 statStages[NUM_BATTLE_STATS];
/*0x20*/ u8 ability; /*0x20*/ u8 ability;
/*0x21*/ u8 type1; /*0x21*/ u8 type1;
@ -507,7 +507,7 @@ u8 CalculatePlayerPartyCount(void);
u8 CalculateEnemyPartyCount(void); u8 CalculateEnemyPartyCount(void);
u8 GetMonsStateToDoubles(void); u8 GetMonsStateToDoubles(void);
u8 GetMonsStateToDoubles_2(void); u8 GetMonsStateToDoubles_2(void);
u8 GetAbilityBySpecies(u16 species, bool8 altAbility); u8 GetAbilityBySpecies(u16 species, bool8 abilityNum);
u8 GetMonAbility(struct Pokemon *mon); u8 GetMonAbility(struct Pokemon *mon);
void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord); void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord);
u8 GetSecretBaseTrainerPicIndex(void); u8 GetSecretBaseTrainerPicIndex(void);

View File

@ -93,7 +93,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
continue; continue;
GetMonData(&party[i], MON_DATA_SPECIES); // Unused return value. GetMonData(&party[i], MON_DATA_SPECIES); // Unused return value.
GetMonData(&party[i], MON_DATA_ALT_ABILITY); // Unused return value. GetMonData(&party[i], MON_DATA_ABILITY_NUM); // Unused return value.
for (opposingBattler = GetBattlerAtPosition(opposingPosition), j = 0; j < MAX_MON_MOVES; j++) for (opposingBattler = GetBattlerAtPosition(opposingPosition), j = 0; j < MAX_MON_MOVES; j++)
{ {
@ -197,7 +197,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
continue; continue;
species = GetMonData(&party[i], MON_DATA_SPECIES); species = GetMonData(&party[i], MON_DATA_SPECIES);
if (GetMonData(&party[i], MON_DATA_ALT_ABILITY) != 0) if (GetMonData(&party[i], MON_DATA_ABILITY_NUM) != 0)
monAbility = gBaseStats[species].ability2; monAbility = gBaseStats[species].ability2;
else else
monAbility = gBaseStats[species].ability1; monAbility = gBaseStats[species].ability1;
@ -392,7 +392,7 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
continue; continue;
species = GetMonData(&party[i], MON_DATA_SPECIES); species = GetMonData(&party[i], MON_DATA_SPECIES);
if (GetMonData(&party[i], MON_DATA_ALT_ABILITY) != 0) if (GetMonData(&party[i], MON_DATA_ABILITY_NUM) != 0)
monAbility = gBaseStats[species].ability2; monAbility = gBaseStats[species].ability2;
else else
monAbility = gBaseStats[species].ability1; monAbility = gBaseStats[species].ability1;

View File

@ -602,7 +602,7 @@ static u32 CopyLinkOpponentMonData(u8 monId, u8 *dst)
battleMon.spAttack = GetMonData(&gEnemyParty[monId], MON_DATA_SPATK); battleMon.spAttack = GetMonData(&gEnemyParty[monId], MON_DATA_SPATK);
battleMon.spDefense = GetMonData(&gEnemyParty[monId], MON_DATA_SPDEF); battleMon.spDefense = GetMonData(&gEnemyParty[monId], MON_DATA_SPDEF);
battleMon.isEgg = GetMonData(&gEnemyParty[monId], MON_DATA_IS_EGG); battleMon.isEgg = GetMonData(&gEnemyParty[monId], MON_DATA_IS_EGG);
battleMon.altAbility = GetMonData(&gEnemyParty[monId], MON_DATA_ALT_ABILITY); battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM);
battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID); battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID);
GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname); GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname);
StringCopy10(battleMon.nickname, nickname); StringCopy10(battleMon.nickname, nickname);

View File

@ -487,7 +487,7 @@ static u32 CopyLinkPartnerMonData(u8 monId, u8 *dst)
battleMon.spAttack = GetMonData(&gPlayerParty[monId], MON_DATA_SPATK); battleMon.spAttack = GetMonData(&gPlayerParty[monId], MON_DATA_SPATK);
battleMon.spDefense = GetMonData(&gPlayerParty[monId], MON_DATA_SPDEF); battleMon.spDefense = GetMonData(&gPlayerParty[monId], MON_DATA_SPDEF);
battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG); battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG);
battleMon.altAbility = GetMonData(&gPlayerParty[monId], MON_DATA_ALT_ABILITY); battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM);
battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID);
GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname);
StringCopy10(battleMon.nickname, nickname); StringCopy10(battleMon.nickname, nickname);

View File

@ -585,7 +585,7 @@ static u32 GetOpponentMonData(u8 monId, u8 *dst)
battleMon.spAttack = GetMonData(&gEnemyParty[monId], MON_DATA_SPATK); battleMon.spAttack = GetMonData(&gEnemyParty[monId], MON_DATA_SPATK);
battleMon.spDefense = GetMonData(&gEnemyParty[monId], MON_DATA_SPDEF); battleMon.spDefense = GetMonData(&gEnemyParty[monId], MON_DATA_SPDEF);
battleMon.isEgg = GetMonData(&gEnemyParty[monId], MON_DATA_IS_EGG); battleMon.isEgg = GetMonData(&gEnemyParty[monId], MON_DATA_IS_EGG);
battleMon.altAbility = GetMonData(&gEnemyParty[monId], MON_DATA_ALT_ABILITY); battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM);
battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID); battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID);
GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname); GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname);
StringCopy10(battleMon.nickname, nickname); StringCopy10(battleMon.nickname, nickname);

View File

@ -1628,7 +1628,7 @@ static u32 CopyPlayerMonData(u8 monId, u8 *dst)
battleMon.spAttack = GetMonData(&gPlayerParty[monId], MON_DATA_SPATK); battleMon.spAttack = GetMonData(&gPlayerParty[monId], MON_DATA_SPATK);
battleMon.spDefense = GetMonData(&gPlayerParty[monId], MON_DATA_SPDEF); battleMon.spDefense = GetMonData(&gPlayerParty[monId], MON_DATA_SPDEF);
battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG); battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG);
battleMon.altAbility = GetMonData(&gPlayerParty[monId], MON_DATA_ALT_ABILITY); battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM);
battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID);
GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname);
StringCopy10(battleMon.nickname, nickname); StringCopy10(battleMon.nickname, nickname);

View File

@ -672,7 +672,7 @@ static u32 CopyPlayerPartnerMonData(u8 monId, u8 *dst)
battleMon.spAttack = GetMonData(&gPlayerParty[monId], MON_DATA_SPATK); battleMon.spAttack = GetMonData(&gPlayerParty[monId], MON_DATA_SPATK);
battleMon.spDefense = GetMonData(&gPlayerParty[monId], MON_DATA_SPDEF); battleMon.spDefense = GetMonData(&gPlayerParty[monId], MON_DATA_SPDEF);
battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG); battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG);
battleMon.altAbility = GetMonData(&gPlayerParty[monId], MON_DATA_ALT_ABILITY); battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM);
battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID);
GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname);
StringCopy10(battleMon.nickname, nickname); StringCopy10(battleMon.nickname, nickname);

View File

@ -584,7 +584,7 @@ static u32 CopyRecordedOpponentMonData(u8 monId, u8 *dst)
battleMon.spAttack = GetMonData(&gEnemyParty[monId], MON_DATA_SPATK); battleMon.spAttack = GetMonData(&gEnemyParty[monId], MON_DATA_SPATK);
battleMon.spDefense = GetMonData(&gEnemyParty[monId], MON_DATA_SPDEF); battleMon.spDefense = GetMonData(&gEnemyParty[monId], MON_DATA_SPDEF);
battleMon.isEgg = GetMonData(&gEnemyParty[monId], MON_DATA_IS_EGG); battleMon.isEgg = GetMonData(&gEnemyParty[monId], MON_DATA_IS_EGG);
battleMon.altAbility = GetMonData(&gEnemyParty[monId], MON_DATA_ALT_ABILITY); battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM);
battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID); battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID);
GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname); GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname);
StringCopy10(battleMon.nickname, nickname); StringCopy10(battleMon.nickname, nickname);

View File

@ -567,7 +567,7 @@ static u32 CopyRecordedPlayerMonData(u8 monId, u8 *dst)
battleMon.spAttack = GetMonData(&gPlayerParty[monId], MON_DATA_SPATK); battleMon.spAttack = GetMonData(&gPlayerParty[monId], MON_DATA_SPATK);
battleMon.spDefense = GetMonData(&gPlayerParty[monId], MON_DATA_SPDEF); battleMon.spDefense = GetMonData(&gPlayerParty[monId], MON_DATA_SPDEF);
battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG); battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG);
battleMon.altAbility = GetMonData(&gPlayerParty[monId], MON_DATA_ALT_ABILITY); battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM);
battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID);
GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname);
StringCopy10(battleMon.nickname, nickname); StringCopy10(battleMon.nickname, nickname);

View File

@ -485,7 +485,7 @@ static u32 CopyWallyMonData(u8 monId, u8 *dst)
battleMon.spAttack = GetMonData(&gPlayerParty[monId], MON_DATA_SPATK); battleMon.spAttack = GetMonData(&gPlayerParty[monId], MON_DATA_SPATK);
battleMon.spDefense = GetMonData(&gPlayerParty[monId], MON_DATA_SPDEF); battleMon.spDefense = GetMonData(&gPlayerParty[monId], MON_DATA_SPDEF);
battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG); battleMon.isEgg = GetMonData(&gPlayerParty[monId], MON_DATA_IS_EGG);
battleMon.altAbility = GetMonData(&gPlayerParty[monId], MON_DATA_ALT_ABILITY); battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM);
battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID);
GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname);
StringCopy10(battleMon.nickname, nickname); StringCopy10(battleMon.nickname, nickname);

View File

@ -373,7 +373,7 @@ static void SetRentalsToOpponentParty(void)
gSaveBlock2Ptr->frontier.rentalMons[i + 3].monId = gUnknown_03006298[i]; gSaveBlock2Ptr->frontier.rentalMons[i + 3].monId = gUnknown_03006298[i];
gSaveBlock2Ptr->frontier.rentalMons[i + 3].ivs = GetBoxMonData(&gEnemyParty[i].box, MON_DATA_ATK_IV, NULL); gSaveBlock2Ptr->frontier.rentalMons[i + 3].ivs = GetBoxMonData(&gEnemyParty[i].box, MON_DATA_ATK_IV, NULL);
gSaveBlock2Ptr->frontier.rentalMons[i + 3].personality = GetMonData(&gEnemyParty[i], MON_DATA_PERSONALITY, NULL); gSaveBlock2Ptr->frontier.rentalMons[i + 3].personality = GetMonData(&gEnemyParty[i], MON_DATA_PERSONALITY, NULL);
gSaveBlock2Ptr->frontier.rentalMons[i + 3].abilityBit = GetBoxMonData(&gEnemyParty[i].box, MON_DATA_ALT_ABILITY, NULL); gSaveBlock2Ptr->frontier.rentalMons[i + 3].abilityNum = GetBoxMonData(&gEnemyParty[i].box, MON_DATA_ABILITY_NUM, NULL);
SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[gUnknown_03006298[i]].itemTableId]); SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[gUnknown_03006298[i]].itemTableId]);
} }
} }
@ -439,7 +439,7 @@ static void SetPlayerAndOpponentParties(void)
SetMonMoveAvoidReturn(&gPlayerParty[i], gFacilityTrainerMons[monSetId].moves[k], k); SetMonMoveAvoidReturn(&gPlayerParty[i], gFacilityTrainerMons[monSetId].moves[k], k);
SetMonData(&gPlayerParty[i], MON_DATA_FRIENDSHIP, &friendship); SetMonData(&gPlayerParty[i], MON_DATA_FRIENDSHIP, &friendship);
SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]); SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]);
SetMonData(&gPlayerParty[i], MON_DATA_ALT_ABILITY, &gSaveBlock2Ptr->frontier.rentalMons[i].abilityBit); SetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM, &gSaveBlock2Ptr->frontier.rentalMons[i].abilityNum);
} }
} }
@ -478,7 +478,7 @@ static void SetPlayerAndOpponentParties(void)
for (k = 0; k < MAX_MON_MOVES; k++) for (k = 0; k < MAX_MON_MOVES; k++)
SetMonMoveAvoidReturn(&gEnemyParty[i], gFacilityTrainerMons[monSetId].moves[k], k); SetMonMoveAvoidReturn(&gEnemyParty[i], gFacilityTrainerMons[monSetId].moves[k], k);
SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]); SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]);
SetMonData(&gEnemyParty[i], MON_DATA_ALT_ABILITY, &gSaveBlock2Ptr->frontier.rentalMons[i + 3].abilityBit); SetMonData(&gEnemyParty[i], MON_DATA_ABILITY_NUM, &gSaveBlock2Ptr->frontier.rentalMons[i + 3].abilityNum);
} }
break; break;
} }

View File

@ -1742,7 +1742,7 @@ static void Select_CopyMonsToPlayerParty(void)
gPlayerParty[i] = sFactorySelectScreen->mons[j].monData; gPlayerParty[i] = sFactorySelectScreen->mons[j].monData;
gSaveBlock2Ptr->frontier.rentalMons[i].monId = sFactorySelectScreen->mons[j].monSetId; gSaveBlock2Ptr->frontier.rentalMons[i].monId = sFactorySelectScreen->mons[j].monSetId;
gSaveBlock2Ptr->frontier.rentalMons[i].personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY, NULL); gSaveBlock2Ptr->frontier.rentalMons[i].personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY, NULL);
gSaveBlock2Ptr->frontier.rentalMons[i].abilityBit = GetBoxMonData(&gPlayerParty[i].box, MON_DATA_ALT_ABILITY, NULL); gSaveBlock2Ptr->frontier.rentalMons[i].abilityNum = GetBoxMonData(&gPlayerParty[i].box, MON_DATA_ABILITY_NUM, NULL);
gSaveBlock2Ptr->frontier.rentalMons[i].ivs = GetBoxMonData(&gPlayerParty[i].box, MON_DATA_ATK_IV, NULL); gSaveBlock2Ptr->frontier.rentalMons[i].ivs = GetBoxMonData(&gPlayerParty[i].box, MON_DATA_ATK_IV, NULL);
break; break;
} }
@ -2266,7 +2266,7 @@ static void CopySwappedMonData(void)
gSaveBlock2Ptr->frontier.rentalMons[sFactorySwapScreen->playerMonId].monId = gSaveBlock2Ptr->frontier.rentalMons[sFactorySwapScreen->enemyMonId + 3].monId; gSaveBlock2Ptr->frontier.rentalMons[sFactorySwapScreen->playerMonId].monId = gSaveBlock2Ptr->frontier.rentalMons[sFactorySwapScreen->enemyMonId + 3].monId;
gSaveBlock2Ptr->frontier.rentalMons[sFactorySwapScreen->playerMonId].ivs = gSaveBlock2Ptr->frontier.rentalMons[sFactorySwapScreen->enemyMonId + 3].ivs; gSaveBlock2Ptr->frontier.rentalMons[sFactorySwapScreen->playerMonId].ivs = gSaveBlock2Ptr->frontier.rentalMons[sFactorySwapScreen->enemyMonId + 3].ivs;
gSaveBlock2Ptr->frontier.rentalMons[sFactorySwapScreen->playerMonId].personality = GetMonData(&gEnemyParty[sFactorySwapScreen->enemyMonId], MON_DATA_PERSONALITY, NULL); gSaveBlock2Ptr->frontier.rentalMons[sFactorySwapScreen->playerMonId].personality = GetMonData(&gEnemyParty[sFactorySwapScreen->enemyMonId], MON_DATA_PERSONALITY, NULL);
gSaveBlock2Ptr->frontier.rentalMons[sFactorySwapScreen->playerMonId].abilityBit = GetBoxMonData(&gEnemyParty[sFactorySwapScreen->enemyMonId].box, MON_DATA_ALT_ABILITY, NULL); gSaveBlock2Ptr->frontier.rentalMons[sFactorySwapScreen->playerMonId].abilityNum = GetBoxMonData(&gEnemyParty[sFactorySwapScreen->enemyMonId].box, MON_DATA_ABILITY_NUM, NULL);
} }
static void Task_FromSwapScreenToSummaryScreen(u8 taskId) static void Task_FromSwapScreenToSummaryScreen(u8 taskId)

View File

@ -3390,7 +3390,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1; gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1;
gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2; gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2;
gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].altAbility); gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum);
hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(gActiveBattler)]; hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(gActiveBattler)];
*hpOnSwitchout = gBattleMons[gActiveBattler].hp; *hpOnSwitchout = gBattleMons[gActiveBattler].hp;
for (i = 0; i < NUM_BATTLE_STATS; i++) for (i = 0; i < NUM_BATTLE_STATS; i++)

View File

@ -1122,7 +1122,7 @@ bool32 TryGenerateBattlePikeWildMon(bool8 checkKeenEyeIntimidate)
u8 headerId = GetBattlePikeWildMonHeaderId(); u8 headerId = GetBattlePikeWildMonHeaderId();
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
const struct PikeWildMon *const *const wildMons = sWildMons[lvlMode]; const struct PikeWildMon *const *const wildMons = sWildMons[lvlMode];
u32 abilityBit; u32 abilityNum;
s32 pikeMonId = GetMonData(&gEnemyParty[0], MON_DATA_SPECIES, NULL); s32 pikeMonId = GetMonData(&gEnemyParty[0], MON_DATA_SPECIES, NULL);
pikeMonId = SpeciesToPikeMonId(pikeMonId); pikeMonId = SpeciesToPikeMonId(pikeMonId);
@ -1153,10 +1153,10 @@ bool32 TryGenerateBattlePikeWildMon(bool8 checkKeenEyeIntimidate)
&gExperienceTables[gBaseStats[wildMons[headerId][pikeMonId].species].growthRate][monLevel]); &gExperienceTables[gBaseStats[wildMons[headerId][pikeMonId].species].growthRate][monLevel]);
if (gBaseStats[wildMons[headerId][pikeMonId].species].ability2) if (gBaseStats[wildMons[headerId][pikeMonId].species].ability2)
abilityBit = Random() % 2; abilityNum = Random() % 2;
else else
abilityBit = 0; abilityNum = 0;
SetMonData(&gEnemyParty[0], MON_DATA_ALT_ABILITY, &abilityBit); SetMonData(&gEnemyParty[0], MON_DATA_ABILITY_NUM, &abilityNum);
for (i = 0; i < MAX_MON_MOVES; i++) for (i = 0; i < MAX_MON_MOVES; i++)
SetMonMoveSlot(&gEnemyParty[0], wildMons[headerId][pikeMonId].moves[i], i); SetMonMoveSlot(&gEnemyParty[0], wildMons[headerId][pikeMonId].moves[i], i);

View File

@ -76,7 +76,7 @@ struct PyramidWildMon
{ {
u16 species; u16 species;
u8 lvl; u8 lvl;
u8 abilityBit; u8 abilityNum;
u16 moves[4]; u16 moves[4];
}; };
@ -1401,23 +1401,23 @@ void GenerateBattlePyramidWildMon(void)
MON_DATA_EXP, MON_DATA_EXP,
&gExperienceTables[gBaseStats[wildMons[id].species].growthRate][lvl]); &gExperienceTables[gBaseStats[wildMons[id].species].growthRate][lvl]);
switch (wildMons[id].abilityBit) switch (wildMons[id].abilityNum)
{ {
case 0: case 0:
case 1: case 1:
SetMonData(&gEnemyParty[0], MON_DATA_ALT_ABILITY, &wildMons[id].abilityBit); SetMonData(&gEnemyParty[0], MON_DATA_ABILITY_NUM, &wildMons[id].abilityNum);
break; break;
case 2: case 2:
default: default:
if (gBaseStats[wildMons[id].species].ability2) if (gBaseStats[wildMons[id].species].ability2)
{ {
i = GetMonData(&gEnemyParty[0], MON_DATA_PERSONALITY, NULL) % 2; i = GetMonData(&gEnemyParty[0], MON_DATA_PERSONALITY, NULL) % 2;
SetMonData(&gEnemyParty[0], MON_DATA_ALT_ABILITY, &i); SetMonData(&gEnemyParty[0], MON_DATA_ABILITY_NUM, &i);
} }
else else
{ {
i = 0; i = 0;
SetMonData(&gEnemyParty[0], MON_DATA_ALT_ABILITY, &i); SetMonData(&gEnemyParty[0], MON_DATA_ABILITY_NUM, &i);
} }
break; break;
} }

View File

@ -4906,7 +4906,7 @@ static void atk4D_switchindataupdate(void)
gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1; gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1;
gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2; gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2;
gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].altAbility); gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum);
// check knocked off item // check knocked off item
i = GetBattlerSide(gActiveBattler); i = GetBattlerSide(gActiveBattler);
@ -8622,7 +8622,7 @@ static void atkAE_healpartystatus(void)
for (i = 0; i < PARTY_SIZE; i++) for (i = 0; i < PARTY_SIZE; i++)
{ {
u16 species = GetMonData(&party[i], MON_DATA_SPECIES2); u16 species = GetMonData(&party[i], MON_DATA_SPECIES2);
u8 abilityBit = GetMonData(&party[i], MON_DATA_ALT_ABILITY); u8 abilityNum = GetMonData(&party[i], MON_DATA_ABILITY_NUM);
if (species != SPECIES_NONE && species != SPECIES_EGG) if (species != SPECIES_NONE && species != SPECIES_EGG)
{ {
@ -8635,7 +8635,7 @@ static void atkAE_healpartystatus(void)
&& !(gAbsentBattlerFlags & gBitTable[gActiveBattler])) && !(gAbsentBattlerFlags & gBitTable[gActiveBattler]))
ability = gBattleMons[gActiveBattler].ability; ability = gBattleMons[gActiveBattler].ability;
else else
ability = GetAbilityBySpecies(species, abilityBit); ability = GetAbilityBySpecies(species, abilityNum);
if (ability != ABILITY_SOUNDPROOF) if (ability != ABILITY_SOUNDPROOF)
toHeal |= (1 << i); toHeal |= (1 << i);
@ -9844,7 +9844,7 @@ static void atkE5_pickup(void)
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2); species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
if (GetMonData(&gPlayerParty[i], MON_DATA_ALT_ABILITY)) if (GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM))
ability = gBaseStats[species].ability2; ability = gBaseStats[species].ability2;
else else
ability = gBaseStats[species].ability1; ability = gBaseStats[species].ability1;
@ -9867,7 +9867,7 @@ static void atkE5_pickup(void)
species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2); species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
if (GetMonData(&gPlayerParty[i], MON_DATA_ALT_ABILITY)) if (GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM))
ability = gBaseStats[species].ability2; ability = gBaseStats[species].ability2;
else else
ability = gBaseStats[species].ability1; ability = gBaseStats[species].ability1;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1433,7 +1433,7 @@ void PutZigzagoonInPlayerParty(void)
u16 monData; u16 monData;
CreateMon(&gPlayerParty[0], SPECIES_ZIGZAGOON, 7, 0x20, FALSE, 0, FALSE, 0); CreateMon(&gPlayerParty[0], SPECIES_ZIGZAGOON, 7, 0x20, FALSE, 0, FALSE, 0);
monData = TRUE; monData = TRUE;
SetMonData(&gPlayerParty[0], MON_DATA_ALT_ABILITY, &monData); SetMonData(&gPlayerParty[0], MON_DATA_ABILITY_NUM, &monData);
monData = MOVE_TACKLE; monData = MOVE_TACKLE;
SetMonData(&gPlayerParty[0], MON_DATA_MOVE1, &monData); SetMonData(&gPlayerParty[0], MON_DATA_MOVE1, &monData);
monData = MOVE_NONE; monData = MOVE_NONE;

View File

@ -2251,7 +2251,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV,
if (gBaseStats[species].ability2) if (gBaseStats[species].ability2)
{ {
value = personality & 1; value = personality & 1;
SetBoxMonData(boxMon, MON_DATA_ALT_ABILITY, &value); SetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, &value);
} }
GiveBoxMonInitialMoveset(boxMon); GiveBoxMonInitialMoveset(boxMon);
@ -2402,8 +2402,8 @@ void CreateBattleTowerMon(struct Pokemon *mon, struct BattleTowerPokemon *src)
SetMonData(mon, MON_DATA_SPEED_EV, &src->speedEV); SetMonData(mon, MON_DATA_SPEED_EV, &src->speedEV);
SetMonData(mon, MON_DATA_SPATK_EV, &src->spAttackEV); SetMonData(mon, MON_DATA_SPATK_EV, &src->spAttackEV);
SetMonData(mon, MON_DATA_SPDEF_EV, &src->spDefenseEV); SetMonData(mon, MON_DATA_SPDEF_EV, &src->spDefenseEV);
value = src->altAbility; value = src->abilityNum;
SetMonData(mon, MON_DATA_ALT_ABILITY, &value); SetMonData(mon, MON_DATA_ABILITY_NUM, &value);
value = src->hpIV; value = src->hpIV;
SetMonData(mon, MON_DATA_HP_IV, &value); SetMonData(mon, MON_DATA_HP_IV, &value);
value = src->attackIV; value = src->attackIV;
@ -2464,8 +2464,8 @@ void CreateBattleTowerMon2(struct Pokemon *mon, struct BattleTowerPokemon *src,
SetMonData(mon, MON_DATA_SPEED_EV, &src->speedEV); SetMonData(mon, MON_DATA_SPEED_EV, &src->speedEV);
SetMonData(mon, MON_DATA_SPATK_EV, &src->spAttackEV); SetMonData(mon, MON_DATA_SPATK_EV, &src->spAttackEV);
SetMonData(mon, MON_DATA_SPDEF_EV, &src->spDefenseEV); SetMonData(mon, MON_DATA_SPDEF_EV, &src->spDefenseEV);
value = src->altAbility; value = src->abilityNum;
SetMonData(mon, MON_DATA_ALT_ABILITY, &value); SetMonData(mon, MON_DATA_ABILITY_NUM, &value);
value = src->hpIV; value = src->hpIV;
SetMonData(mon, MON_DATA_HP_IV, &value); SetMonData(mon, MON_DATA_HP_IV, &value);
value = src->attackIV; value = src->attackIV;
@ -2580,7 +2580,7 @@ void sub_80686FC(struct Pokemon *mon, struct BattleTowerPokemon *dest)
dest->speedIV = GetMonData(mon, MON_DATA_SPEED_IV, NULL); dest->speedIV = GetMonData(mon, MON_DATA_SPEED_IV, NULL);
dest->spAttackIV = GetMonData(mon, MON_DATA_SPATK_IV, NULL); dest->spAttackIV = GetMonData(mon, MON_DATA_SPATK_IV, NULL);
dest->spDefenseIV = GetMonData(mon, MON_DATA_SPDEF_IV, NULL); dest->spDefenseIV = GetMonData(mon, MON_DATA_SPDEF_IV, NULL);
dest->altAbility = GetMonData(mon, MON_DATA_ALT_ABILITY, NULL); dest->abilityNum = GetMonData(mon, MON_DATA_ABILITY_NUM, NULL);
dest->personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL); dest->personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL);
GetMonData(mon, MON_DATA_NICKNAME, dest->nickname); GetMonData(mon, MON_DATA_NICKNAME, dest->nickname);
} }
@ -3842,8 +3842,8 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data)
case MON_DATA_IS_EGG: case MON_DATA_IS_EGG:
retVal = substruct3->isEgg; retVal = substruct3->isEgg;
break; break;
case MON_DATA_ALT_ABILITY: case MON_DATA_ABILITY_NUM:
retVal = substruct3->altAbility; retVal = substruct3->abilityNum;
break; break;
case MON_DATA_COOL_RIBBON: case MON_DATA_COOL_RIBBON:
retVal = substruct3->coolRibbon; retVal = substruct3->coolRibbon;
@ -4221,8 +4221,8 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
else else
boxMon->isEgg = 0; boxMon->isEgg = 0;
break; break;
case MON_DATA_ALT_ABILITY: case MON_DATA_ABILITY_NUM:
SET8(substruct3->altAbility); SET8(substruct3->abilityNum);
break; break;
case MON_DATA_COOL_RIBBON: case MON_DATA_COOL_RIBBON:
SET8(substruct3->coolRibbon); SET8(substruct3->coolRibbon);
@ -4429,9 +4429,9 @@ u8 GetMonsStateToDoubles_2(void)
return (aliveCount > 1) ? PLAYER_HAS_TWO_USABLE_MONS : PLAYER_HAS_ONE_USABLE_MON; return (aliveCount > 1) ? PLAYER_HAS_TWO_USABLE_MONS : PLAYER_HAS_ONE_USABLE_MON;
} }
u8 GetAbilityBySpecies(u16 species, bool8 altAbility) u8 GetAbilityBySpecies(u16 species, bool8 abilityNum)
{ {
if (altAbility) if (abilityNum)
gLastUsedAbility = gBaseStats[species].ability2; gLastUsedAbility = gBaseStats[species].ability2;
else else
gLastUsedAbility = gBaseStats[species].ability1; gLastUsedAbility = gBaseStats[species].ability1;
@ -4442,8 +4442,8 @@ u8 GetAbilityBySpecies(u16 species, bool8 altAbility)
u8 GetMonAbility(struct Pokemon *mon) u8 GetMonAbility(struct Pokemon *mon)
{ {
u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
u8 altAbility = GetMonData(mon, MON_DATA_ALT_ABILITY, NULL); u8 abilityNum = GetMonData(mon, MON_DATA_ABILITY_NUM, NULL);
return GetAbilityBySpecies(species, altAbility); return GetAbilityBySpecies(species, abilityNum);
} }
void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord) void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord)
@ -4586,11 +4586,11 @@ void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex)
gBattleMons[battlerId].spAttack = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPATK, NULL); gBattleMons[battlerId].spAttack = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPATK, NULL);
gBattleMons[battlerId].spDefense = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPDEF, NULL); gBattleMons[battlerId].spDefense = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPDEF, NULL);
gBattleMons[battlerId].isEgg = GetMonData(&gPlayerParty[partyIndex], MON_DATA_IS_EGG, NULL); gBattleMons[battlerId].isEgg = GetMonData(&gPlayerParty[partyIndex], MON_DATA_IS_EGG, NULL);
gBattleMons[battlerId].altAbility = GetMonData(&gPlayerParty[partyIndex], MON_DATA_ALT_ABILITY, NULL); gBattleMons[battlerId].abilityNum = GetMonData(&gPlayerParty[partyIndex], MON_DATA_ABILITY_NUM, NULL);
gBattleMons[battlerId].otId = GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_ID, NULL); gBattleMons[battlerId].otId = GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_ID, NULL);
gBattleMons[battlerId].type1 = gBaseStats[gBattleMons[battlerId].species].type1; gBattleMons[battlerId].type1 = gBaseStats[gBattleMons[battlerId].species].type1;
gBattleMons[battlerId].type2 = gBaseStats[gBattleMons[battlerId].species].type2; gBattleMons[battlerId].type2 = gBaseStats[gBattleMons[battlerId].species].type2;
gBattleMons[battlerId].ability = GetAbilityBySpecies(gBattleMons[battlerId].species, gBattleMons[battlerId].altAbility); gBattleMons[battlerId].ability = GetAbilityBySpecies(gBattleMons[battlerId].species, gBattleMons[battlerId].abilityNum);
GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, nickname); GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, nickname);
StringCopy10(gBattleMons[battlerId].nickname, nickname); StringCopy10(gBattleMons[battlerId].nickname, nickname);
GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_NAME, gBattleMons[battlerId].otName); GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_NAME, gBattleMons[battlerId].otName);

View File

@ -115,7 +115,7 @@ static EWRAM_DATA struct PokemonSummaryScreenData
u8 level; // 0x5 u8 level; // 0x5
u8 ribbonCount; // 0x6 u8 ribbonCount; // 0x6
u8 ailment; // 0x7 u8 ailment; // 0x7
u8 altAbility; // 0x8 u8 abilityNum; // 0x8
u8 metLocation; // 0x9 u8 metLocation; // 0x9
u8 metLevel; // 0xA u8 metLevel; // 0xA
u8 metGame; // 0xB u8 metGame; // 0xB
@ -1356,7 +1356,7 @@ static bool8 ExtractMonDataToSummaryStruct(struct Pokemon *mon)
sum->species2 = GetMonData(mon, MON_DATA_SPECIES2); sum->species2 = GetMonData(mon, MON_DATA_SPECIES2);
sum->exp = GetMonData(mon, MON_DATA_EXP); sum->exp = GetMonData(mon, MON_DATA_EXP);
sum->level = GetMonData(mon, MON_DATA_LEVEL); sum->level = GetMonData(mon, MON_DATA_LEVEL);
sum->altAbility = GetMonData(mon, MON_DATA_ALT_ABILITY); sum->abilityNum = GetMonData(mon, MON_DATA_ABILITY_NUM);
sum->item = GetMonData(mon, MON_DATA_HELD_ITEM); sum->item = GetMonData(mon, MON_DATA_HELD_ITEM);
sum->pid = GetMonData(mon, MON_DATA_PERSONALITY); sum->pid = GetMonData(mon, MON_DATA_PERSONALITY);
sum->sanity = GetMonData(mon, MON_DATA_SANITY_IS_BAD_EGG); sum->sanity = GetMonData(mon, MON_DATA_SANITY_IS_BAD_EGG);
@ -3062,13 +3062,13 @@ static void PrintMonOTID(void)
static void PrintMonAbilityName(void) static void PrintMonAbilityName(void)
{ {
u8 ability = GetAbilityBySpecies(sMonSummaryScreen->summary.species, sMonSummaryScreen->summary.altAbility); u8 ability = GetAbilityBySpecies(sMonSummaryScreen->summary.species, sMonSummaryScreen->summary.abilityNum);
SummaryScreen_PrintTextOnWindow(AddWindowFromTemplateList(sPageInfoTemplate, PSS_DATA_WINDOW_INFO_ABILITY), gAbilityNames[ability], 0, 1, 0, 1); SummaryScreen_PrintTextOnWindow(AddWindowFromTemplateList(sPageInfoTemplate, PSS_DATA_WINDOW_INFO_ABILITY), gAbilityNames[ability], 0, 1, 0, 1);
} }
static void PrintMonAbilityDescription(void) static void PrintMonAbilityDescription(void)
{ {
u8 ability = GetAbilityBySpecies(sMonSummaryScreen->summary.species, sMonSummaryScreen->summary.altAbility); u8 ability = GetAbilityBySpecies(sMonSummaryScreen->summary.species, sMonSummaryScreen->summary.abilityNum);
SummaryScreen_PrintTextOnWindow(AddWindowFromTemplateList(sPageInfoTemplate, PSS_DATA_WINDOW_INFO_ABILITY), gAbilityDescriptionPointers[ability], 0, 17, 0, 0); SummaryScreen_PrintTextOnWindow(AddWindowFromTemplateList(sPageInfoTemplate, PSS_DATA_WINDOW_INFO_ABILITY), gAbilityDescriptionPointers[ability], 0, 17, 0, 0);
} }

View File

@ -5840,7 +5840,7 @@ static void _CreateInGameTradePokemon(u8 whichPlayerMon, u8 whichInGameTrade)
SetMonData(pokemon, MON_DATA_NICKNAME, inGameTrade->name); SetMonData(pokemon, MON_DATA_NICKNAME, inGameTrade->name);
SetMonData(pokemon, MON_DATA_OT_NAME, inGameTrade->otName); SetMonData(pokemon, MON_DATA_OT_NAME, inGameTrade->otName);
SetMonData(pokemon, MON_DATA_OT_GENDER, &inGameTrade->otGender); SetMonData(pokemon, MON_DATA_OT_GENDER, &inGameTrade->otGender);
SetMonData(pokemon, MON_DATA_ALT_ABILITY, &inGameTrade->secondAbility); SetMonData(pokemon, MON_DATA_ABILITY_NUM, &inGameTrade->secondAbility);
SetMonData(pokemon, MON_DATA_BEAUTY, &inGameTrade->stats[1]); SetMonData(pokemon, MON_DATA_BEAUTY, &inGameTrade->stats[1]);
SetMonData(pokemon, MON_DATA_CUTE, &inGameTrade->stats[2]); SetMonData(pokemon, MON_DATA_CUTE, &inGameTrade->stats[2]);
SetMonData(pokemon, MON_DATA_COOL, &inGameTrade->stats[0]); SetMonData(pokemon, MON_DATA_COOL, &inGameTrade->stats[0]);