Config for Plus and Minus interaction

This commit is contained in:
Eduardo Quezada D'Ottone 2022-07-18 08:11:02 -04:00
parent 61f2011b36
commit 1dcbf59686
2 changed files with 20 additions and 0 deletions

View file

@ -191,6 +191,7 @@
#define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if a Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned.
#define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. It also activates Rattled.
#define B_OBLIVIOUS_TAUNT GEN_7 // In Gen6+, Pokémon with Oblivious can't be taunted.
#define B_PLUS_MINUS_INTERACTION GEN_7 // In Gen5+, Plus and Minus can be activated with themselves and the opposite ability. Before, only the opposing ability could activate it.
// Item settings
#define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn.

View file

@ -8657,6 +8657,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b
if (moveType == TYPE_GRASS && gBattleMons[battlerAtk].hp <= (gBattleMons[battlerAtk].maxHP / 3))
MulModifier(&modifier, UQ_4_12(1.5));
break;
#if B_PLUS_MINUS_INTERACTION >= GEN_5
case ABILITY_PLUS:
case ABILITY_MINUS:
if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk)))
@ -8666,6 +8667,24 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b
MulModifier(&modifier, UQ_4_12(1.5));
}
break;
#else
case ABILITY_PLUS:
if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk)))
{
u32 partnerAbility = GetBattlerAbility(BATTLE_PARTNER(battlerAtk));
if (partnerAbility == ABILITY_MINUS)
MulModifier(&modifier, UQ_4_12(1.5));
}
break;
case ABILITY_MINUS:
if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk)))
{
u32 partnerAbility = GetBattlerAbility(BATTLE_PARTNER(battlerAtk));
if (partnerAbility == ABILITY_PLUS)
MulModifier(&modifier, UQ_4_12(1.5));
}
break;
#endif
case ABILITY_FLOWER_GIFT:
if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN) && IS_MOVE_PHYSICAL(move))
MulModifier(&modifier, UQ_4_12(1.5));