Fix incorrect Adaptability interaction with non Tera type moves after Terastalization (#9272)
This commit is contained in:
parent
eb68d746e2
commit
e2df932775
@ -163,15 +163,19 @@ uq4_12_t GetTeraMultiplier(struct DamageContext *ctx)
|
|||||||
else
|
else
|
||||||
return UQ_4_12(2.0);
|
return UQ_4_12(2.0);
|
||||||
}
|
}
|
||||||
// Base or Tera type only.
|
// Tera type only (Adaptability applies).
|
||||||
else if ((ctx->moveType == teraType && !IS_BATTLER_OF_BASE_TYPE(ctx->battlerAtk, ctx->moveType))
|
else if (ctx->moveType == teraType && !IS_BATTLER_OF_BASE_TYPE(ctx->battlerAtk, ctx->moveType))
|
||||||
|| (ctx->moveType != teraType && IS_BATTLER_OF_BASE_TYPE(ctx->battlerAtk, ctx->moveType)))
|
|
||||||
{
|
{
|
||||||
if (ctx->abilityAtk == ABILITY_ADAPTABILITY)
|
if (ctx->abilityAtk == ABILITY_ADAPTABILITY)
|
||||||
return UQ_4_12(2.0);
|
return UQ_4_12(2.0);
|
||||||
else
|
else
|
||||||
return UQ_4_12(1.5);
|
return UQ_4_12(1.5);
|
||||||
}
|
}
|
||||||
|
// Base type only (Adaptability does not apply while Terastallized).
|
||||||
|
else if (ctx->moveType != teraType && IS_BATTLER_OF_BASE_TYPE(ctx->battlerAtk, ctx->moveType))
|
||||||
|
{
|
||||||
|
return UQ_4_12(1.5);
|
||||||
|
}
|
||||||
// Neither base or Tera type.
|
// Neither base or Tera type.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -61,4 +61,39 @@ SINGLE_BATTLE_TEST("(TERA) Terastallizing into the same type with Adaptability g
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TO_DO_BATTLE_TEST("Adaptability does not affect Stellar-type moves");
|
SINGLE_BATTLE_TEST("(TERA) Adaptability does not increase non-Tera base STAB beyond 1.5x", s16 damage)
|
||||||
|
{
|
||||||
|
u32 move;
|
||||||
|
PARAMETRIZE { move = MOVE_GUST; }
|
||||||
|
PARAMETRIZE { move = MOVE_WATER_GUN; }
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CRAWDAUNT) { Ability(ABILITY_ADAPTABILITY); TeraType(TYPE_NORMAL); }
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, move, gimmick: GIMMICK_TERA); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, move, player);
|
||||||
|
HP_BAR(opponent, captureDamage: &results[i].damage);
|
||||||
|
} FINALLY {
|
||||||
|
// With Adaptability, non-Tera base type should still be 1.5x STAB (not 2.0x).
|
||||||
|
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("(TERA) Adaptability does not affect Stellar-type moves", s16 damage)
|
||||||
|
{
|
||||||
|
u32 ability;
|
||||||
|
PARAMETRIZE { ability = ABILITY_HYPER_CUTTER; }
|
||||||
|
PARAMETRIZE { ability = ABILITY_ADAPTABILITY; }
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_CRAWDAUNT) { Ability(ability); TeraType(TYPE_STELLAR); }
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_TERA_BLAST, gimmick: GIMMICK_TERA); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TERA_BLAST, player);
|
||||||
|
HP_BAR(opponent, captureDamage: &results[i].damage);
|
||||||
|
} FINALLY {
|
||||||
|
EXPECT_EQ(results[0].damage, results[1].damage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user