Requested changes
- Tabs / spaces where proper - HitFromAtkString -> HitFromAccCheck - Actually compiles now lol - Moved assumes into relevant tests - Cleaned up the check for TryUpperHand
This commit is contained in:
parent
537075f23a
commit
7987a72c4d
5 changed files with 30 additions and 28 deletions
|
@ -1583,10 +1583,10 @@
|
||||||
callnative BS_SetPhotonGeyserCategory
|
callnative BS_SetPhotonGeyserCategory
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro tryupperhand failInstr:req
|
.macro tryupperhand failInstr:req
|
||||||
callnative BS_TryUpperHand
|
callnative BS_TryUpperHand
|
||||||
.4byte \failInstr
|
.4byte \failInstr
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
@ various command changed to more readable macros
|
@ various command changed to more readable macros
|
||||||
.macro cancelmultiturnmoves battler:req
|
.macro cancelmultiturnmoves battler:req
|
||||||
|
|
|
@ -20,11 +20,10 @@
|
||||||
|
|
||||||
.section script_data, "aw", %progbits
|
.section script_data, "aw", %progbits
|
||||||
|
|
||||||
BattleScript_EffectUpperHand:
|
BattleScript_EffectUpperHand::
|
||||||
attackcanceler
|
attackcanceler
|
||||||
tryupperhand BattleScript_FailedFromAtkString
|
tryupperhand BattleScript_FailedFromAtkString
|
||||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
goto BattleScript_HitFromAccCheck
|
||||||
goto BattleScript_HitFromAtkString
|
|
||||||
|
|
||||||
BattleScript_EffectShedTail::
|
BattleScript_EffectShedTail::
|
||||||
attackcanceler
|
attackcanceler
|
||||||
|
|
|
@ -822,5 +822,6 @@ extern const u8 BattleScript_EffectBrickBreak[];
|
||||||
extern const u8 BattleScript_EffectDoodle[];
|
extern const u8 BattleScript_EffectDoodle[];
|
||||||
extern const u8 BattleScript_EffectFilletAway[];
|
extern const u8 BattleScript_EffectFilletAway[];
|
||||||
extern const u8 BattleScript_EffectShedTail[];
|
extern const u8 BattleScript_EffectShedTail[];
|
||||||
|
extern const u8 BattleScript_EffectUpperHand[];
|
||||||
|
|
||||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||||
|
|
|
@ -16527,18 +16527,14 @@ void BS_TryDefog(void)
|
||||||
|
|
||||||
void BS_TryUpperHand(void)
|
void BS_TryUpperHand(void)
|
||||||
{
|
{
|
||||||
NATIVE_ARGS(const u8 *failInstr);
|
NATIVE_ARGS(const u8 *failInstr);
|
||||||
|
|
||||||
if (gProtectStructs[gBattlerTarget].obstructed) // Fails if target is obstructed
|
if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget) ||
|
||||||
gBattlescriptCurrInstr = cmd->failInstr;
|
IS_MOVE_STATUS(gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]]) ||
|
||||||
else if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) // Fails if user moves after target
|
GetChosenMovePriority(gBattlerTarget) <= 0 || GetChosenMovePriority(gBattlerTarget) > 3) // Fails if priority is not greater than 0 or greater than 3, if target already moved, or if using a status move
|
||||||
gBattlescriptCurrInstr = cmd->failInstr;
|
gBattlescriptCurrInstr = cmd->failInstr;
|
||||||
else if (IS_MOVE_STATUS(gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]])) // Fails if target is using a status move
|
else
|
||||||
gBattlescriptCurrInstr = cmd->failInstr;
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
else if (GetChosenMovePriority(gBattlerTarget) <= 0) // Fails if priority is not greater than 0
|
|
||||||
gBattlescriptCurrInstr = cmd->failInstr;
|
|
||||||
else
|
|
||||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BS_TryTriggerStatusForm(void)
|
void BS_TryTriggerStatusForm(void)
|
||||||
|
|
|
@ -6,18 +6,13 @@ ASSUMPTIONS
|
||||||
ASSUME(gBattleMoves[MOVE_UPPER_HAND].effect == EFFECT_UPPER_HAND);
|
ASSUME(gBattleMoves[MOVE_UPPER_HAND].effect == EFFECT_UPPER_HAND);
|
||||||
ASSUME(gBattleMoves[MOVE_UPPER_HAND].priority == 3);
|
ASSUME(gBattleMoves[MOVE_UPPER_HAND].priority == 3);
|
||||||
ASSUME(MoveHasMoveEffect(MOVE_UPPER_HAND, MOVE_EFFECT_FLINCH) == TRUE);
|
ASSUME(MoveHasMoveEffect(MOVE_UPPER_HAND, MOVE_EFFECT_FLINCH) == TRUE);
|
||||||
ASSUME(gBattleMoves[MOVE_UPPER_HAND].sheerForceBoost == TRUE);
|
|
||||||
ASSUME(gBattleMoves[MOVE_BABY_DOLL_EYES].category == BATTLE_CATEGORY_STATUS);
|
|
||||||
ASSUME(gBattleMoves[MOVE_BABY_DOLL_EYES].priority == 1);
|
|
||||||
ASSUME(gBattleMoves[MOVE_EXTREME_SPEED].category == BATTLE_CATEGORY_PHYSICAL);
|
|
||||||
ASSUME(gBattleMoves[MOVE_EXTREME_SPEED].priority == 2);
|
|
||||||
ASSUME(gBattleMoves[MOVE_DRAINING_KISS].category == BATTLE_CATEGORY_SPECIAL);
|
|
||||||
ASSUME(gBattleMoves[MOVE_DRAINING_KISS].priority == 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SINGLE_BATTLE_TEST("Upper Hand succeeds if the target is using a priority attacking move and causes it to flinch")
|
SINGLE_BATTLE_TEST("Upper Hand succeeds if the target is using a priority attacking move and causes it to flinch")
|
||||||
{
|
{
|
||||||
GIVEN {
|
GIVEN {
|
||||||
|
ASSUME(gBattleMoves[MOVE_EXTREME_SPEED].category == BATTLE_CATEGORY_PHYSICAL);
|
||||||
|
ASSUME(gBattleMoves[MOVE_EXTREME_SPEED].priority == 2);
|
||||||
PLAYER(SPECIES_MIENSHAO);
|
PLAYER(SPECIES_MIENSHAO);
|
||||||
OPPONENT(SPECIES_WOBBUFFET);
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
} WHEN {
|
} WHEN {
|
||||||
|
@ -33,6 +28,8 @@ SINGLE_BATTLE_TEST("Upper Hand succeeds if the target is using a priority attack
|
||||||
SINGLE_BATTLE_TEST("Upper Hand fails if the target is using a status move")
|
SINGLE_BATTLE_TEST("Upper Hand fails if the target is using a status move")
|
||||||
{
|
{
|
||||||
GIVEN {
|
GIVEN {
|
||||||
|
ASSUME(gBattleMoves[MOVE_BABY_DOLL_EYES].category == BATTLE_CATEGORY_STATUS);
|
||||||
|
ASSUME(gBattleMoves[MOVE_BABY_DOLL_EYES].priority == 1);
|
||||||
PLAYER(SPECIES_MIENSHAO);
|
PLAYER(SPECIES_MIENSHAO);
|
||||||
OPPONENT(SPECIES_WOBBUFFET);
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
} WHEN {
|
} WHEN {
|
||||||
|
@ -50,6 +47,8 @@ SINGLE_BATTLE_TEST("Upper Hand fails if the target is using a status move")
|
||||||
SINGLE_BATTLE_TEST("Upper Hand fails if the target is not using a priority move")
|
SINGLE_BATTLE_TEST("Upper Hand fails if the target is not using a priority move")
|
||||||
{
|
{
|
||||||
GIVEN {
|
GIVEN {
|
||||||
|
ASSUME(gBattleMoves[MOVE_DRAINING_KISS].category == BATTLE_CATEGORY_SPECIAL);
|
||||||
|
ASSUME(gBattleMoves[MOVE_DRAINING_KISS].priority == 0);
|
||||||
PLAYER(SPECIES_MIENSHAO);
|
PLAYER(SPECIES_MIENSHAO);
|
||||||
OPPONENT(SPECIES_COMFEY) { Ability(ABILITY_FLOWER_VEIL); }
|
OPPONENT(SPECIES_COMFEY) { Ability(ABILITY_FLOWER_VEIL); }
|
||||||
} WHEN {
|
} WHEN {
|
||||||
|
@ -67,6 +66,8 @@ SINGLE_BATTLE_TEST("Upper Hand fails if the target is not using a priority move"
|
||||||
TO_DO_BATTLE_TEST("Upper Hand succeeds if the target's move is boosted in priority by an Ability")
|
TO_DO_BATTLE_TEST("Upper Hand succeeds if the target's move is boosted in priority by an Ability")
|
||||||
{
|
{
|
||||||
GIVEN {
|
GIVEN {
|
||||||
|
ASSUME(gBattleMoves[MOVE_DRAINING_KISS].category == BATTLE_CATEGORY_SPECIAL);
|
||||||
|
ASSUME(gBattleMoves[MOVE_DRAINING_KISS].priority == 0);
|
||||||
PLAYER(SPECIES_MIENSHAO) { Speed(10); }
|
PLAYER(SPECIES_MIENSHAO) { Speed(10); }
|
||||||
OPPONENT(SPECIES_COMFEY) { Speed(5); Ability(ABILITY_TRIAGE); }
|
OPPONENT(SPECIES_COMFEY) { Speed(5); Ability(ABILITY_TRIAGE); }
|
||||||
} WHEN {
|
} WHEN {
|
||||||
|
@ -82,6 +83,8 @@ TO_DO_BATTLE_TEST("Upper Hand succeeds if the target's move is boosted in priori
|
||||||
SINGLE_BATTLE_TEST("Upper Hand fails if the target moves first")
|
SINGLE_BATTLE_TEST("Upper Hand fails if the target moves first")
|
||||||
{
|
{
|
||||||
GIVEN {
|
GIVEN {
|
||||||
|
ASSUME(gBattleMoves[MOVE_DRAINING_KISS].category == BATTLE_CATEGORY_SPECIAL);
|
||||||
|
ASSUME(gBattleMoves[MOVE_DRAINING_KISS].priority == 0);
|
||||||
PLAYER(SPECIES_MIENSHAO) { Speed(5); }
|
PLAYER(SPECIES_MIENSHAO) { Speed(5); }
|
||||||
OPPONENT(SPECIES_COMFEY) { Speed(10); Ability(ABILITY_TRIAGE); }
|
OPPONENT(SPECIES_COMFEY) { Speed(10); Ability(ABILITY_TRIAGE); }
|
||||||
} WHEN {
|
} WHEN {
|
||||||
|
@ -99,6 +102,9 @@ SINGLE_BATTLE_TEST("Upper Hand fails if the target moves first")
|
||||||
SINGLE_BATTLE_TEST("Upper Hand is boosted by Sheer Force")
|
SINGLE_BATTLE_TEST("Upper Hand is boosted by Sheer Force")
|
||||||
{
|
{
|
||||||
GIVEN {
|
GIVEN {
|
||||||
|
ASSUME(gBattleMoves[MOVE_EXTREME_SPEED].category == BATTLE_CATEGORY_PHYSICAL);
|
||||||
|
ASSUME(gBattleMoves[MOVE_EXTREME_SPEED].priority == 2);
|
||||||
|
ASSUME(gBattleMoves[MOVE_UPPER_HAND].sheerForceBoost == TRUE);
|
||||||
PLAYER(SPECIES_HARIYAMA) { Ability(ABILITY_SHEER_FORCE); }
|
PLAYER(SPECIES_HARIYAMA) { Ability(ABILITY_SHEER_FORCE); }
|
||||||
OPPONENT(SPECIES_WOBBUFFET);
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
} WHEN {
|
} WHEN {
|
||||||
|
|
Loading…
Reference in a new issue