Fix Intimidate Contrary in double battles

This commit is contained in:
DizzyEggg 2023-10-01 19:06:43 +02:00
parent f840f7eb56
commit dc119b27c2
2 changed files with 48 additions and 1 deletions

View File

@ -8537,6 +8537,7 @@ BattleScript_IntimidateLoop:
jumpifability BS_TARGET, ABILITY_GUARD_DOG, BattleScript_IntimidateInReverse jumpifability BS_TARGET, ABILITY_GUARD_DOG, BattleScript_IntimidateInReverse
BattleScript_IntimidateEffect: BattleScript_IntimidateEffect:
copybyte sBATTLER, gBattlerAttacker copybyte sBATTLER, gBattlerAttacker
setstatchanger STAT_ATK, 1, TRUE
statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_IntimidateLoopIncrement statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_IntimidateLoopIncrement
setgraphicalstatchangevalues setgraphicalstatchangevalues
jumpifability BS_TARGET, ABILITY_CONTRARY, BattleScript_IntimidateContrary jumpifability BS_TARGET, ABILITY_CONTRARY, BattleScript_IntimidateContrary

View File

@ -6,7 +6,7 @@ ASSUMPTIONS
ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL);
} }
SINGLE_BATTLE_TEST("Contrary raises Attack when Intimidated", s16 damage) SINGLE_BATTLE_TEST("Contrary raises Attack when Intimidated in a single battle", s16 damage)
{ {
u32 ability; u32 ability;
PARAMETRIZE { ability = ABILITY_CONTRARY; } PARAMETRIZE { ability = ABILITY_CONTRARY; }
@ -30,6 +30,52 @@ SINGLE_BATTLE_TEST("Contrary raises Attack when Intimidated", s16 damage)
} }
} }
DOUBLE_BATTLE_TEST("Contrary raises Attack when Intimidated in a double battle", s16 damageLeft, s16 damageRight)
{
u32 abilityLeft, abilityRight;
PARAMETRIZE { abilityLeft = ABILITY_CONTRARY; abilityRight = ABILITY_CONTRARY; }
PARAMETRIZE { abilityLeft = ABILITY_TANGLED_FEET; abilityRight = ABILITY_TANGLED_FEET; }
PARAMETRIZE { abilityLeft = ABILITY_CONTRARY; abilityRight = ABILITY_TANGLED_FEET; }
PARAMETRIZE { abilityLeft = ABILITY_TANGLED_FEET; abilityRight = ABILITY_CONTRARY; }
GIVEN {
PLAYER(SPECIES_MIGHTYENA) { Ability(ABILITY_INTIMIDATE); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_SPINDA) { Ability(abilityLeft); }
OPPONENT(SPECIES_SPINDA) { Ability(abilityRight); }
} WHEN {
TURN { MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft); MOVE(opponentRight, MOVE_TACKLE, target: playerRight); }
} SCENE {
ABILITY_POPUP(playerLeft, ABILITY_INTIMIDATE);
if (abilityLeft == ABILITY_CONTRARY) {
ABILITY_POPUP(opponentLeft, ABILITY_CONTRARY);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft);
MESSAGE("Foe Spinda's Attack rose!");
} else {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft);
MESSAGE("Mightyena's Intimidate cuts Foe Spinda's attack!");
}
if (abilityRight == ABILITY_CONTRARY) {
ABILITY_POPUP(opponentRight, ABILITY_CONTRARY);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight);
MESSAGE("Foe Spinda's Attack rose!");
} else {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight);
MESSAGE("Mightyena's Intimidate cuts Foe Spinda's attack!");
}
HP_BAR(playerLeft, captureDamage: &results[i].damageLeft);
HP_BAR(playerRight, captureDamage: &results[i].damageRight);
} THEN {
EXPECT_EQ(opponentLeft->statStages[STAT_ATK], (abilityLeft == ABILITY_CONTRARY) ? DEFAULT_STAT_STAGE+1 : DEFAULT_STAT_STAGE-1);
EXPECT_EQ(opponentRight->statStages[STAT_ATK], (abilityRight == ABILITY_CONTRARY) ? DEFAULT_STAT_STAGE+1 : DEFAULT_STAT_STAGE-1);
}
FINALLY {
EXPECT_MUL_EQ(results[1].damageLeft, Q_4_12(2.25), results[0].damageLeft);
EXPECT_MUL_EQ(results[1].damageRight, Q_4_12(2.25), results[0].damageRight);
}
}
SINGLE_BATTLE_TEST("Contrary raises stats after using a move which would normally lower them: Overheat", s16 damageBefore, s16 damageAfter) SINGLE_BATTLE_TEST("Contrary raises stats after using a move which would normally lower them: Overheat", s16 damageBefore, s16 damageAfter)
{ {
u32 ability; u32 ability;