Fixes heal blocked leeach seed in tests (#5700)
This commit is contained in:
parent
3cc048cc01
commit
612c8d3ff6
5 changed files with 98 additions and 28 deletions
|
@ -6032,33 +6032,34 @@ BattleScript_SafeguardEnds::
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
end2
|
end2
|
||||||
|
|
||||||
BattleScript_LeechSeedTurnDrain::
|
BattleScript_LeechSeedTurnDrainLiquidOoze::
|
||||||
playanimation BS_ATTACKER, B_ANIM_LEECH_SEED_DRAIN, sB_ANIM_ARG1
|
call BattleScript_LeechSeedTurnDrain
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
manipulatedamage DMG_CHANGE_SIGN
|
||||||
healthbarupdate BS_ATTACKER
|
|
||||||
datahpupdate BS_ATTACKER
|
|
||||||
copyword gBattleMoveDamage, gHpDealt
|
|
||||||
jumpifability BS_ATTACKER, ABILITY_LIQUID_OOZE, BattleScript_LeechSeedTurnPrintLiquidOoze
|
|
||||||
setbyte cMULTISTRING_CHOOSER, B_MSG_LEECH_SEED_DRAIN
|
|
||||||
jumpifstatus3 BS_TARGET, STATUS3_HEAL_BLOCK, BattleScript_LeechSeedHealBlock
|
|
||||||
manipulatedamage DMG_BIG_ROOT
|
|
||||||
goto BattleScript_LeechSeedTurnPrintAndUpdateHp
|
|
||||||
BattleScript_LeechSeedTurnPrintLiquidOoze::
|
|
||||||
copybyte gBattlerAbility, gBattlerAttacker
|
copybyte gBattlerAbility, gBattlerAttacker
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
setbyte cMULTISTRING_CHOOSER, B_MSG_LEECH_SEED_OOZE
|
goto BattleScript_LeechSeedTurnDrainGainHp
|
||||||
BattleScript_LeechSeedTurnPrintAndUpdateHp::
|
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
BattleScript_LeechSeedTurnDrainHealBlock::
|
||||||
|
call BattleScript_LeechSeedTurnDrain
|
||||||
|
end2
|
||||||
|
|
||||||
|
BattleScript_LeechSeedTurnDrainRecovery::
|
||||||
|
call BattleScript_LeechSeedTurnDrain
|
||||||
|
BattleScript_LeechSeedTurnDrainGainHp:
|
||||||
|
manipulatedamage DMG_BIG_ROOT
|
||||||
healthbarupdate BS_TARGET
|
healthbarupdate BS_TARGET
|
||||||
datahpupdate BS_TARGET
|
datahpupdate BS_TARGET
|
||||||
printfromtable gLeechSeedStringIds
|
printfromtable gLeechSeedStringIds
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
tryfaintmon BS_ATTACKER
|
|
||||||
tryfaintmon BS_TARGET
|
tryfaintmon BS_TARGET
|
||||||
end2
|
end2
|
||||||
BattleScript_LeechSeedHealBlock:
|
|
||||||
setword gBattleMoveDamage, 0
|
BattleScript_LeechSeedTurnDrain:
|
||||||
goto BattleScript_LeechSeedTurnPrintAndUpdateHp
|
playanimation BS_ATTACKER, B_ANIM_LEECH_SEED_DRAIN, sB_ANIM_ARG1
|
||||||
|
healthbarupdate BS_ATTACKER
|
||||||
|
datahpupdate BS_ATTACKER
|
||||||
|
tryfaintmon BS_ATTACKER
|
||||||
|
return
|
||||||
|
|
||||||
BattleScript_BideStoringEnergy::
|
BattleScript_BideStoringEnergy::
|
||||||
printstring STRINGID_PKMNSTORINGENERGY
|
printstring STRINGID_PKMNSTORINGENERGY
|
||||||
|
|
|
@ -65,7 +65,9 @@ extern const u8 BattleScript_OverworldTerrain[];
|
||||||
extern const u8 BattleScript_SideStatusWoreOff[];
|
extern const u8 BattleScript_SideStatusWoreOff[];
|
||||||
extern const u8 BattleScript_SafeguardProtected[];
|
extern const u8 BattleScript_SafeguardProtected[];
|
||||||
extern const u8 BattleScript_SafeguardEnds[];
|
extern const u8 BattleScript_SafeguardEnds[];
|
||||||
extern const u8 BattleScript_LeechSeedTurnDrain[];
|
extern const u8 BattleScript_LeechSeedTurnDrainLiquidOoze[];
|
||||||
|
extern const u8 BattleScript_LeechSeedTurnDrainHealBlock[];
|
||||||
|
extern const u8 BattleScript_LeechSeedTurnDrainRecovery[];
|
||||||
extern const u8 BattleScript_BideStoringEnergy[];
|
extern const u8 BattleScript_BideStoringEnergy[];
|
||||||
extern const u8 BattleScript_BideAttack[];
|
extern const u8 BattleScript_BideAttack[];
|
||||||
extern const u8 BattleScript_BideNoEnergyToAttack[];
|
extern const u8 BattleScript_BideNoEnergyToAttack[];
|
||||||
|
|
|
@ -5722,9 +5722,7 @@ static void Cmd_moveend(void)
|
||||||
}
|
}
|
||||||
else if (IsBattlerAlive(gBattlerAttacker) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
|
else if (IsBattlerAlive(gBattlerAttacker) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
|
||||||
{
|
{
|
||||||
gBattleMoveDamage = (gHpDealt * gMovesInfo[gCurrentMove].argument / 100);
|
gBattleMoveDamage = max(1, (gHpDealt * gMovesInfo[gCurrentMove].argument / 100));
|
||||||
if (gBattleMoveDamage == 0)
|
|
||||||
gBattleMoveDamage = 1;
|
|
||||||
gBattleMoveDamage = GetDrainedBigRootHp(gBattlerAttacker, gBattleMoveDamage);
|
gBattleMoveDamage = GetDrainedBigRootHp(gBattlerAttacker, gBattleMoveDamage);
|
||||||
gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE;
|
gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE;
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
|
|
|
@ -2436,12 +2436,25 @@ u8 DoBattlerEndTurnEffects(void)
|
||||||
&& !IsBattlerProtectedByMagicGuard(battler, ability))
|
&& !IsBattlerProtectedByMagicGuard(battler, ability))
|
||||||
{
|
{
|
||||||
gBattlerTarget = gStatuses3[battler] & STATUS3_LEECHSEED_BATTLER; // Notice gBattlerTarget is actually the HP receiver.
|
gBattlerTarget = gStatuses3[battler] & STATUS3_LEECHSEED_BATTLER; // Notice gBattlerTarget is actually the HP receiver.
|
||||||
gBattleMoveDamage = GetNonDynamaxMaxHP(battler) / 8;
|
gBattlerAttacker = battler;
|
||||||
if (gBattleMoveDamage == 0)
|
|
||||||
gBattleMoveDamage = 1;
|
|
||||||
gBattleScripting.animArg1 = gBattlerTarget;
|
gBattleScripting.animArg1 = gBattlerTarget;
|
||||||
gBattleScripting.animArg2 = gBattlerAttacker;
|
gBattleScripting.animArg2 = gBattlerAttacker;
|
||||||
BattleScriptExecute(BattleScript_LeechSeedTurnDrain);
|
gBattleMoveDamage = max(1, GetNonDynamaxMaxHP(battler) / 8);
|
||||||
|
gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE;
|
||||||
|
if (GetBattlerAbility(battler) == ABILITY_LIQUID_OOZE)
|
||||||
|
{
|
||||||
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LEECH_SEED_OOZE;
|
||||||
|
BattleScriptExecute(BattleScript_LeechSeedTurnDrainLiquidOoze);
|
||||||
|
}
|
||||||
|
else if (gStatuses3[gBattlerTarget] & STATUS3_HEAL_BLOCK)
|
||||||
|
{
|
||||||
|
BattleScriptExecute(BattleScript_LeechSeedTurnDrainHealBlock);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LEECH_SEED_DRAIN;
|
||||||
|
BattleScriptExecute(BattleScript_LeechSeedTurnDrainRecovery);
|
||||||
|
}
|
||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
gBattleStruct->turnEffectsTracker++;
|
gBattleStruct->turnEffectsTracker++;
|
||||||
|
|
|
@ -20,8 +20,64 @@ SINGLE_BATTLE_TEST("Leech Seed doesn't affect Grass-type Pokémon")
|
||||||
MESSAGE("It doesn't affect the opposing Oddish…");
|
MESSAGE("It doesn't affect the opposing Oddish…");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Leech Seeded targets lose 1/8 of its max HP every turn and give it to the user")
|
||||||
|
{
|
||||||
|
s16 damage;
|
||||||
|
s16 healed;
|
||||||
|
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WYNAUT) { HP(1); }
|
||||||
|
OPPONENT(SPECIES_SHELLDER);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_LEECH_SEED); }
|
||||||
|
TURN {}
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_LEECH_SEED, player);
|
||||||
|
HP_BAR(opponent);
|
||||||
|
HP_BAR(player);
|
||||||
|
HP_BAR(opponent, captureDamage: &damage);
|
||||||
|
HP_BAR(player, captureDamage: &healed);
|
||||||
|
} THEN {
|
||||||
|
EXPECT_MUL_EQ(damage, Q_4_12(-1), healed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Leech Seed recovery is prevented by Heal Block")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WYNAUT) { HP(1); }
|
||||||
|
OPPONENT(SPECIES_SHELLDER);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(opponent, MOVE_HEAL_BLOCK); MOVE(player, MOVE_LEECH_SEED); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_HEAL_BLOCK, opponent);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_LEECH_SEED, player);
|
||||||
|
HP_BAR(opponent);
|
||||||
|
NOT HP_BAR(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Leech Seed recovery will drain the hp of user if leech seeded mon has Liquid Ooze")
|
||||||
|
{
|
||||||
|
s16 damage;
|
||||||
|
s16 healed;
|
||||||
|
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WYNAUT);
|
||||||
|
OPPONENT(SPECIES_TENTACOOL) { Ability(ABILITY_LIQUID_OOZE); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_LEECH_SEED); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_LEECH_SEED, player);
|
||||||
|
HP_BAR(opponent, captureDamage: &damage);
|
||||||
|
HP_BAR(player, captureDamage: &healed);
|
||||||
|
} THEN {
|
||||||
|
EXPECT_EQ(damage, healed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TO_DO_BATTLE_TEST("Leech Seed doesn't affect already seeded targets")
|
TO_DO_BATTLE_TEST("Leech Seed doesn't affect already seeded targets")
|
||||||
TO_DO_BATTLE_TEST("Leech Seeded targets lose 1/8 of its max HP every turn and give it to the user")
|
|
||||||
TO_DO_BATTLE_TEST("Leech Seed's effect is paused until a new battler replaces the original user's position") // Faint, can't be replaced, then revived.
|
TO_DO_BATTLE_TEST("Leech Seed's effect is paused until a new battler replaces the original user's position") // Faint, can't be replaced, then revived.
|
||||||
TO_DO_BATTLE_TEST("Leech Seed's effect pause still prevents it from being seeded again")
|
TO_DO_BATTLE_TEST("Leech Seed's effect pause still prevents it from being seeded again")
|
||||||
TO_DO_BATTLE_TEST("Baton Pass passes Leech Seed's effect");
|
TO_DO_BATTLE_TEST("Baton Pass passes Leech Seed's effect");
|
||||||
|
|
Loading…
Reference in a new issue