diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 39af970dad..6aff255f1a 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4475,6 +4475,7 @@ static void atk4D_switchindataupdate(void) gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1; gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2; + gBattleMons[gActiveBattler].type3 = TYPE_MYSTERY; gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].altAbility); // check knocked off item @@ -8059,7 +8060,8 @@ static void atk90_tryconversiontypechange(void) // randomly changes user's type moveType = TYPE_NORMAL; } if (moveType != gBattleMons[gBattlerAttacker].type1 - && moveType != gBattleMons[gBattlerAttacker].type2) + && moveType != gBattleMons[gBattlerAttacker].type2 + && moveType != gBattleMons[gBattlerAttacker].type3) { break; } @@ -8086,7 +8088,7 @@ static void atk90_tryconversiontypechange(void) // randomly changes user's type moveType = TYPE_NORMAL; } } - while (moveType == gBattleMons[gBattlerAttacker].type1 || moveType == gBattleMons[gBattlerAttacker].type2); + while (moveType == gBattleMons[gBattlerAttacker].type1 || moveType == gBattleMons[gBattlerAttacker].type2 || moveType == gBattleMons[gBattlerAttacker].type3); SET_BATTLER_TYPE(gBattlerAttacker, moveType); PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType); diff --git a/src/battle_util.c b/src/battle_util.c index 7dffd85f32..8ad3e85e17 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5016,7 +5016,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe return ApplyModifier(modifier, basePower); } -static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, bool32 isCrit) +u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, bool32 isCrit) { u8 atkStage; u32 atkStat; @@ -5025,20 +5025,28 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b if (gBattleMoves[move].effect == EFFECT_FOUL_PLAY) { if (IS_MOVE_PHYSICAL(move)) + { atkStat = gBattleMons[battlerDef].attack; + atkStage = gBattleMons[battlerDef].statStages[STAT_ATK]; + } else + { atkStat = gBattleMons[battlerDef].spAttack; - - atkStage = gBattleMons[battlerDef].statStages[STAT_ATK]; + atkStage = gBattleMons[battlerDef].statStages[STAT_SPATK]; + } } else { if (IS_MOVE_PHYSICAL(move)) + { atkStat = gBattleMons[battlerAtk].attack; + atkStage = gBattleMons[battlerAtk].statStages[STAT_ATK]; + } else + { atkStat = gBattleMons[battlerAtk].spAttack; - - atkStage = gBattleMons[battlerAtk].statStages[STAT_SPATK]; + atkStage = gBattleMons[battlerAtk].statStages[STAT_SPATK]; + } } // critical hits ignore attack stat's stage drops diff --git a/src/pokemon.c b/src/pokemon.c index 13ab027937..0b661cee9b 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4689,6 +4689,7 @@ void PokemonToBattleMon(struct Pokemon *src, struct BattlePokemon *dst) dst->otId = GetMonData(src, MON_DATA_OT_ID, NULL); dst->type1 = gBaseStats[dst->species].type1; dst->type2 = gBaseStats[dst->species].type2; + dst->type3 = TYPE_MYSTERY; dst->ability = GetAbilityBySpecies(dst->species, dst->altAbility); GetMonData(src, MON_DATA_NICKNAME, nickname); StringCopy10(dst->nickname, nickname);