fix intimidate

This commit is contained in:
DizzyEggg 2023-02-20 13:15:08 +01:00
parent 03915524c5
commit a8c0e1ebeb
3 changed files with 45 additions and 7 deletions

View File

@ -400,17 +400,17 @@ static const struct TrainerMonNoItemDefaultMoves sParty_Rose1[] = {
{
.iv = 0,
.lvl = 14,
.species = SPECIES_PORYGON,
.species = SPECIES_ROSELIA,
},
{
.iv = 0,
.lvl = 14,
.species = SPECIES_PORYGON,
.species = SPECIES_SHROOMISH,
},
{
.iv = 0,
.lvl = 14,
.species = SPECIES_PORYGON,
.species = SPECIES_ROSELIA,
}
};
@ -9631,17 +9631,17 @@ static const struct TrainerMonNoItemDefaultMoves sParty_Deandre[] = {
{
.iv = 0,
.lvl = 14,
.species = SPECIES_PORYGON,
.species = SPECIES_ZIGZAGOON,
},
{
.iv = 0,
.lvl = 14,
.species = SPECIES_PORYGON,
.species = SPECIES_ARON,
},
{
.iv = 0,
.lvl = 14,
.species = SPECIES_PORYGON,
.species = SPECIES_ELECTRIKE,
}
};

29
test/ability_download.c Normal file
View File

@ -0,0 +1,29 @@
#include "global.h"
#include "test_battle.h"
ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL);
}
SINGLE_BATTLE_TEST("Download raises Attack if enemy has greater Atk than Sp.Atk", s16 damage)
{
u32 ability;
PARAMETRIZE { ability = ABILITY_TRACE; }
PARAMETRIZE { ability = ABILITY_DOWNLOAD; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_PORYGON) { Ability(ability); };
} WHEN {
TURN { MOVE(opponent, MOVE_TACKLE); }
} SCENE {
if (ability == ABILITY_DOWNLOAD)
{
ABILITY_POPUP(opponent, ABILITY_DOWNLOAD);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
}
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage);
}
}

View File

@ -20,7 +20,11 @@ SINGLE_BATTLE_TEST("Intimidate (opponent) lowers player's attack after switch ou
TURN { MOVE(player, MOVE_TACKLE); }
} SCENE {
if (ability == ABILITY_INTIMIDATE)
{
ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Foe Staraptor's Intimidate cuts Wobbuffet's ATTACK!");
}
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage);
@ -33,15 +37,20 @@ SINGLE_BATTLE_TEST("Intimidate (opponent) lowers player's attack after KO", s16
PARAMETRIZE { ability = ABILITY_INTIMIDATE; }
PARAMETRIZE { ability = ABILITY_RECKLESS; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Speed(2); Attack(120) ; };
PLAYER(SPECIES_WOBBUFFET) { Speed(2); };
OPPONENT(SPECIES_WOBBUFFET) { HP(1); Speed(1); };
OPPONENT(SPECIES_STARAPTOR) { Ability(ability); Speed(1); };
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); SEND_OUT(opponent, 1); }
TURN { MOVE(player, MOVE_TACKLE); }
} SCENE {
HP_BAR(opponent);
if (ability == ABILITY_INTIMIDATE)
{
ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Foe Staraptor's Intimidate cuts Wobbuffet's ATTACK!");
}
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage);