Fixes Shed Tail substitute health (#5826)
This commit is contained in:
parent
11bc9bd2f2
commit
8f59d9c94f
2 changed files with 27 additions and 1 deletions
|
@ -12638,7 +12638,10 @@ static void Cmd_setsubstitute(void)
|
||||||
|
|
||||||
gBattleMons[gBattlerAttacker].status2 |= STATUS2_SUBSTITUTE;
|
gBattleMons[gBattlerAttacker].status2 |= STATUS2_SUBSTITUTE;
|
||||||
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_WRAPPED;
|
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_WRAPPED;
|
||||||
gDisableStructs[gBattlerAttacker].substituteHP = gBattleMoveDamage;
|
if (factor == 2)
|
||||||
|
gDisableStructs[gBattlerAttacker].substituteHP = gBattleMoveDamage / 2;
|
||||||
|
else
|
||||||
|
gDisableStructs[gBattlerAttacker].substituteHP = gBattleMoveDamage;
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SUBSTITUTE;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SUBSTITUTE;
|
||||||
gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE;
|
gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,3 +99,26 @@ AI_SINGLE_BATTLE_TEST("AI will use Shed Tail to pivot to another mon while in da
|
||||||
TURN { MOVE(player, MOVE_TACKLE); EXPECT_MOVE(opponent, MOVE_SHED_TAIL); }
|
TURN { MOVE(player, MOVE_TACKLE); EXPECT_MOVE(opponent, MOVE_SHED_TAIL); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Shed Tail creates a Substitute with 1/4 of user maximum health")
|
||||||
|
{
|
||||||
|
u32 hp;
|
||||||
|
PARAMETRIZE { hp = 160; }
|
||||||
|
PARAMETRIZE { hp = 164; }
|
||||||
|
|
||||||
|
GIVEN {
|
||||||
|
ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].argument == 40);
|
||||||
|
ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG);
|
||||||
|
PLAYER(SPECIES_BULBASAUR) { MaxHP(hp); }
|
||||||
|
PLAYER(SPECIES_BULBASAUR);
|
||||||
|
OPPONENT(SPECIES_CHARMANDER);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_SHED_TAIL); MOVE(opponent, MOVE_DRAGON_RAGE); SEND_OUT(player, 1); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SHED_TAIL, player);
|
||||||
|
if (hp == 160)
|
||||||
|
MESSAGE("Bulbasaur's substitute faded!");
|
||||||
|
else
|
||||||
|
NOT MESSAGE("Bulbasaur's substitute faded!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue