B_SPORT_DMG_REDUCTION config tests (#8593)
This commit is contained in:
parent
36e71c8236
commit
828e12bee6
@ -32,7 +32,7 @@
|
||||
F(HIDDEN_POWER_DMG, hiddenPowerDmg, (u32, GEN_COUNT - 1)) /* TODO: use in tests */ \
|
||||
F(ROUGH_SKIN_DMG, roughSkinDmg, (u32, GEN_COUNT - 1)) /* TODO: use in tests */ \
|
||||
F(KNOCK_OFF_DMG, knockOffDmg, (u32, GEN_COUNT - 1)) /* TODO: use in tests */ \
|
||||
F(SPORT_DMG_REDUCTION, sportDmgReduction, (u32, GEN_COUNT - 1)) /* TODO: use in tests */ \
|
||||
F(SPORT_DMG_REDUCTION, sportDmgReduction, (u32, GEN_COUNT - 1)) \
|
||||
F(EXPLOSION_DEFENSE, explosionDefense, (u32, GEN_COUNT - 1)) /* TODO: use in tests */ \
|
||||
F(PARENTAL_BOND_DMG, parentalBondDmg, (u32, GEN_COUNT - 1)) /* TODO: use in tests */ \
|
||||
F(MULTIPLE_TARGETS_DMG, multipleTargetsDmg, (u32, GEN_COUNT - 1)) /* TODO: use in tests */ \
|
||||
|
||||
@ -7335,9 +7335,9 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageContext *ctx)
|
||||
if (IsBattlerTerrainAffected(battlerAtk, ctx->abilityAtk, ctx->holdEffectAtk, STATUS_FIELD_PSYCHIC_TERRAIN) && moveType == TYPE_PSYCHIC)
|
||||
modifier = uq4_12_multiply(modifier, (B_TERRAIN_TYPE_BOOST >= GEN_8 ? UQ_4_12(1.3) : UQ_4_12(1.5)));
|
||||
if (IsFieldMudSportAffected(ctx->moveType))
|
||||
modifier = uq4_12_multiply(modifier, UQ_4_12(B_SPORT_DMG_REDUCTION >= GEN_5 ? 0.33 : 0.5));
|
||||
modifier = uq4_12_multiply(modifier, UQ_4_12(GetConfig(CONFIG_SPORT_DMG_REDUCTION) >= GEN_5 ? 0.33 : 0.5));
|
||||
if (IsFieldWaterSportAffected(ctx->moveType))
|
||||
modifier = uq4_12_multiply(modifier, UQ_4_12(B_SPORT_DMG_REDUCTION >= GEN_5 ? 0.33 : 0.5));
|
||||
modifier = uq4_12_multiply(modifier, UQ_4_12(GetConfig(CONFIG_SPORT_DMG_REDUCTION) >= GEN_5 ? 0.33 : 0.5));
|
||||
|
||||
// attacker's abilities
|
||||
switch (ctx->abilityAtk)
|
||||
|
||||
@ -3,11 +3,15 @@
|
||||
|
||||
TO_DO_BATTLE_TEST("TODO: Write Mud Sport (Move Effect) test titles")
|
||||
|
||||
SINGLE_BATTLE_TEST("Mud Sport reduces the damage of Electric Type moves by 67% (Gen5+)")
|
||||
SINGLE_BATTLE_TEST("Mud Sport reduces the damage of Electric Type moves by 50% (Gen3-4) or 67% (Gen5+)")
|
||||
{
|
||||
u32 config;
|
||||
s16 playerDmg[2];
|
||||
s16 opponentDmg[2];
|
||||
PARAMETRIZE { config = GEN_4; }
|
||||
PARAMETRIZE { config = GEN_5; }
|
||||
GIVEN {
|
||||
WITH_CONFIG(CONFIG_SPORT_DMG_REDUCTION, config);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
@ -28,7 +32,13 @@ SINGLE_BATTLE_TEST("Mud Sport reduces the damage of Electric Type moves by 67% (
|
||||
HP_BAR(player, captureDamage: &playerDmg[1]);
|
||||
|
||||
} THEN {
|
||||
EXPECT_MUL_EQ(opponentDmg[0], Q_4_12(0.33), opponentDmg[1]);
|
||||
EXPECT_MUL_EQ(playerDmg[0], Q_4_12(0.33), playerDmg[1]);
|
||||
if (config >= GEN_5) {
|
||||
EXPECT_MUL_EQ(opponentDmg[0], Q_4_12(0.33), opponentDmg[1]);
|
||||
EXPECT_MUL_EQ(playerDmg[0], Q_4_12(0.33), playerDmg[1]);
|
||||
}
|
||||
else {
|
||||
EXPECT_MUL_EQ(opponentDmg[0], Q_4_12(0.5), opponentDmg[1]);
|
||||
EXPECT_MUL_EQ(playerDmg[0], Q_4_12(0.5), playerDmg[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,11 +3,15 @@
|
||||
|
||||
TO_DO_BATTLE_TEST("TODO: Write Water Sport (Move Effect) test titles")
|
||||
|
||||
SINGLE_BATTLE_TEST("Water Sport reduces the damage of Fire Type moves by 67% (Gen5+)")
|
||||
SINGLE_BATTLE_TEST("Water Sport reduces the damage of Fire Type moves by 50% (Gen3-4) or 67% (Gen5+)")
|
||||
{
|
||||
u32 config;
|
||||
s16 playerDmg[2];
|
||||
s16 opponentDmg[2];
|
||||
PARAMETRIZE { config = GEN_4; }
|
||||
PARAMETRIZE { config = GEN_5; }
|
||||
GIVEN {
|
||||
WITH_CONFIG(CONFIG_SPORT_DMG_REDUCTION, config);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
@ -28,7 +32,13 @@ SINGLE_BATTLE_TEST("Water Sport reduces the damage of Fire Type moves by 67% (Ge
|
||||
HP_BAR(player, captureDamage: &playerDmg[1]);
|
||||
|
||||
} THEN {
|
||||
EXPECT_MUL_EQ(opponentDmg[0], Q_4_12(0.33), opponentDmg[1]);
|
||||
EXPECT_MUL_EQ(playerDmg[0], Q_4_12(0.33), playerDmg[1]);
|
||||
if (config >= GEN_5) {
|
||||
EXPECT_MUL_EQ(opponentDmg[0], Q_4_12(0.33), opponentDmg[1]);
|
||||
EXPECT_MUL_EQ(playerDmg[0], Q_4_12(0.33), playerDmg[1]);
|
||||
}
|
||||
else {
|
||||
EXPECT_MUL_EQ(opponentDmg[0], Q_4_12(0.5), opponentDmg[1]);
|
||||
EXPECT_MUL_EQ(playerDmg[0], Q_4_12(0.5), playerDmg[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user