diff options
author | jiangzhengwenjz <jiangzhengwenjzw@qq.com> | 2019-08-03 06:55:42 +0800 |
---|---|---|
committer | jiangzhengwenjz <jiangzhengwenjzw@qq.com> | 2019-08-03 06:55:42 +0800 |
commit | 6a063cf74ad8168e9080c1f3be20e5dfe3c3187c (patch) | |
tree | fb1c3ab1ea836434cdd86be3b4e59a5fc8b8571f /src/pokemon.c | |
parent | 742a7ee1beab323e30d60c599697a2a831c4f4de (diff) |
ported battle_controller_opponent from pokeem and corrected lots of stuff
Diffstat (limited to 'src/pokemon.c')
-rw-r--r-- | src/pokemon.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/pokemon.c b/src/pokemon.c index ec90f6cd4..5f26881ab 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1791,7 +1791,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, if (gBaseStats[species].abilities[1]) { value = personality & 1; - SetBoxMonData(boxMon, MON_DATA_ALT_ABILITY, &value); + SetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, &value); } GiveBoxMonInitialMoveset(boxMon); @@ -1940,8 +1940,8 @@ void CreateBattleTowerMon(struct Pokemon *mon, struct BattleTowerPokemon *src) SetMonData(mon, MON_DATA_SPEED_EV, &src->speedEV); SetMonData(mon, MON_DATA_SPATK_EV, &src->spAttackEV); SetMonData(mon, MON_DATA_SPDEF_EV, &src->spDefenseEV); - value = src->altAbility; - SetMonData(mon, MON_DATA_ALT_ABILITY, &value); + value = src->abilityNum; + SetMonData(mon, MON_DATA_ABILITY_NUM, &value); value = src->hpIV; SetMonData(mon, MON_DATA_HP_IV, &value); value = src->attackIV; @@ -1997,7 +1997,7 @@ void sub_803E23C(struct Pokemon *mon, struct BattleTowerPokemon *dest) dest->speedIV = GetMonData(mon, MON_DATA_SPEED_IV, NULL); dest->spAttackIV = GetMonData(mon, MON_DATA_SPATK_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); GetMonData(mon, MON_DATA_NICKNAME, dest->nickname); } @@ -3099,8 +3099,8 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) case MON_DATA_IS_EGG: retVal = substruct3->isEgg; break; - case MON_DATA_ALT_ABILITY: - retVal = substruct3->altAbility; + case MON_DATA_ABILITY_NUM: + retVal = substruct3->abilityNum; break; case MON_DATA_COOL_RIBBON: retVal = substruct3->coolRibbon; @@ -3502,8 +3502,8 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg) else boxMon->isEgg = 0; break; - case MON_DATA_ALT_ABILITY: - SET8(substruct3->altAbility); + case MON_DATA_ABILITY_NUM: + SET8(substruct3->abilityNum); break; case MON_DATA_COOL_RIBBON: SET8(substruct3->coolRibbon); @@ -3698,9 +3698,9 @@ u8 GetMonsStateToDoubles(void) 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].abilities[1]; else gLastUsedAbility = gBaseStats[species].abilities[0]; @@ -3711,8 +3711,8 @@ u8 GetAbilityBySpecies(u16 species, bool8 altAbility) u8 GetMonAbility(struct Pokemon *mon) { u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); - u8 altAbility = GetMonData(mon, MON_DATA_ALT_ABILITY, NULL); - return GetAbilityBySpecies(species, altAbility); + u8 abilityNum = GetMonData(mon, MON_DATA_ABILITY_NUM, NULL); + return GetAbilityBySpecies(species, abilityNum); } static void CreateSecretBaseEnemyParty(struct SecretBaseRecord *secretBaseRecord) @@ -3858,11 +3858,11 @@ static void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex) gBattleMons[battlerId].spAttack = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPATK, NULL); gBattleMons[battlerId].spDefense = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPDEF, 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].type1 = gBaseStats[gBattleMons[battlerId].species].type1; 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); StringCopy10(gBattleMons[battlerId].nickname, nickname); GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_NAME, gBattleMons[battlerId].otName); |