mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Fixed and more accurate Ruin abilities (#3415)
This commit is contained in:
parent
fef7171c79
commit
70985ed3d6
@ -9022,18 +9022,6 @@ static inline u32 CalcMoveBasePowerAfterModifiers(u32 move, u32 battlerAtk, u32
|
||||
modifier = uq4_12_multiply(modifier, UQ_4_12(1.33));
|
||||
}
|
||||
|
||||
if (IsAbilityOnField(ABILITY_VESSEL_OF_RUIN) && atkAbility != ABILITY_VESSEL_OF_RUIN && IS_MOVE_SPECIAL(gCurrentMove))
|
||||
modifier = uq4_12_multiply(modifier, UQ_4_12(0.75));
|
||||
|
||||
if (IsAbilityOnField(ABILITY_SWORD_OF_RUIN) && defAbility != ABILITY_SWORD_OF_RUIN && IS_MOVE_PHYSICAL(gCurrentMove))
|
||||
modifier = uq4_12_multiply(modifier, UQ_4_12(1.25));
|
||||
|
||||
if (IsAbilityOnField(ABILITY_TABLETS_OF_RUIN) && atkAbility != ABILITY_TABLETS_OF_RUIN && IS_MOVE_PHYSICAL(gCurrentMove))
|
||||
modifier = uq4_12_multiply(modifier, UQ_4_12(0.75));
|
||||
|
||||
if (IsAbilityOnField(ABILITY_BEADS_OF_RUIN) && defAbility != ABILITY_BEADS_OF_RUIN && IS_MOVE_SPECIAL(gCurrentMove))
|
||||
modifier = uq4_12_multiply(modifier, UQ_4_12(1.25));
|
||||
|
||||
// attacker partner's abilities
|
||||
if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk)))
|
||||
{
|
||||
@ -9322,6 +9310,13 @@ static inline u32 CalcAttackStat(u32 move, u32 battlerAtk, u32 battlerDef, u32 m
|
||||
}
|
||||
}
|
||||
|
||||
// field abilities
|
||||
if (IsAbilityOnField(ABILITY_VESSEL_OF_RUIN) && atkAbility != ABILITY_VESSEL_OF_RUIN && IS_MOVE_SPECIAL(move))
|
||||
modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.75));
|
||||
|
||||
if (IsAbilityOnField(ABILITY_TABLETS_OF_RUIN) && atkAbility != ABILITY_TABLETS_OF_RUIN && IS_MOVE_PHYSICAL(move))
|
||||
modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.75));
|
||||
|
||||
// attacker's hold effect
|
||||
switch (holdEffectAtk)
|
||||
{
|
||||
@ -9471,6 +9466,13 @@ static inline u32 CalcDefenseStat(u32 move, u32 battlerAtk, u32 battlerDef, u32
|
||||
}
|
||||
}
|
||||
|
||||
// field abilities
|
||||
if (IsAbilityOnField(ABILITY_SWORD_OF_RUIN) && defAbility != ABILITY_SWORD_OF_RUIN && usesDefStat)
|
||||
modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.75));
|
||||
|
||||
if (IsAbilityOnField(ABILITY_BEADS_OF_RUIN) && defAbility != ABILITY_BEADS_OF_RUIN && !usesDefStat)
|
||||
modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.75));
|
||||
|
||||
// target's hold effects
|
||||
switch (holdEffectDef)
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ SINGLE_BATTLE_TEST("Beads of Ruin reduces Sp. Def", s16 damage)
|
||||
}
|
||||
HP_BAR(opponent, captureDamage: &results[i].damage);
|
||||
} FINALLY {
|
||||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.25), results[1].damage);
|
||||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.33), results[1].damage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ SINGLE_BATTLE_TEST("Sword of Ruin reduces Defense", s16 damage)
|
||||
}
|
||||
HP_BAR(opponent, captureDamage: &results[i].damage);
|
||||
} FINALLY {
|
||||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.25), results[1].damage);
|
||||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.33), results[1].damage);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user