-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Another Gen 9 move batch #3450
Another Gen 9 move batch #3450
Conversation
…_FILLET_AWAY, MOVE_RAGING_BULL, MOVE_SHED_TAIL, MOVE_TIDY_UP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good start!
Just a note, it might be worth configuring your text editor to not trim trailing whitespace from lines because it makes the diffs a little more annoying to read.
.macro tidyupclear battler:req, clear:req, failInstr:req | ||
various \battler, VARIOUS_TIDY_UP | ||
.byte \clear | ||
.4byte \failInstr | ||
.endm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make sense to separate this into two commands (idk what the names should be, but obviously they need to be different):
.macro tidyupclear battler:req, failInstr:req
various \battler, VARIOUS_TIDY_UP
.byte FALSE
.4byte \failInstr
.endm
.macro tidyupclear battler:req
various \battler, VARIOUS_TIDY_UP
.byte TRUE
.4byte NULL
.endm
Because failInstr
isn't actually required in the clear=TRUE
case.
But also we never actually use the clear=FALSE
case in the code as-written. Why does it exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied it from defogclear, which did have that. Forgot to remove it, but it might be useful...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh I think I see what clear
does, if TRUE
then it actually does the clearing, and if FALSE
then it checks if there's anything that can be cleared and if there isn't it branches to failInstr
?
I think it'd be fine to keep them both, and I suppose the names could be tidyupclear
and cantidyupclear
or something like that?
@@ -9640,6 +9669,25 @@ static void Cmd_various(void) | |||
} | |||
return; | |||
} | |||
case VARIOUS_TIDY_UP: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I might have seen somebody comment about this on #expansion-dev, but we've moved away from defining new various
es and now define callnative
s because various
es are harder to read, and can be a merge conflict magnet for downstream users.
ASSUME(gBattleMoves[MOVE_DOODLE].effect == EFFECT_DOODLE); | ||
} | ||
|
||
DOUBLE_BATTLE_TEST("Doodle gives the target's ability to user and ally") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write a/some tests that show Doodle failing if any three of the Pokémon involved have a forbidden ability? PARAMETRIZE
will be useful for this.
Also can we get a SINGLE_BATTLE_TEST
for whatever the expected behavior of Doodle in singles is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doodle in singles is exactly the same as Role Play.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! So in that case I'd copy Role Play's applicable single test(s) and change them to use Doodle.
Or alternatively I suppose you could PARAMETRIZE
those applicable tests over both MOVE_ROLE_PLAY
and MOVE_DOODLE
.
ASSUME(gBattleMoves[MOVE_FILLET_AWAY].effect == EFFECT_FILLET_AWAY); | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Fillet Away cuts the user's HP in half") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should test that the stats have been boosted.
Can you test that this move fails if the HP is too low, or all the stats are at +6 already, and that it succeeds if only some but not all are at +6.
TO_DO_BATTLE_TEST("Shed Tail sets up substitute"); | ||
TO_DO_BATTLE_TEST("Shed Tail transfers substitute to switch in"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write these tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New effects should always have their full tests.
TO_DO_BATTLE_TEST("Tidy Up raises attack and speed by 1 and removes Substitute") | ||
TO_DO_BATTLE_TEST("Tidy Up raises attack and speed by 1 and removes Stealth Rock") | ||
TO_DO_BATTLE_TEST("Tidy Up raises attack and speed by 1 and removes Toxic Spikes") | ||
TO_DO_BATTLE_TEST("Tidy Up raises attack and speed by 1 and removes Sticky Web") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write these tests?
jumpifbattletype BATTLE_TYPE_ARENA, BattleScript_ButItFailed | ||
jumpifcantswitch SWITCH_IGNORE_ESCAPE_PREVENTION | BS_ATTACKER, BattleScript_ButItFailed | ||
setsubstitute | ||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_SUBSTITUTE_FAILED, BattleScript_ButItFailed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this not jump to BattleScript_NotEnoughHPForSubstitute
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't exist. The way the substitute message works is different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So then you should jump to the part of the substitute battle script where it prints the failure string. That way it'll print the correct string using the multistring chooser.
healthbarupdate BS_ATTACKER | ||
datahpupdate BS_ATTACKER | ||
printstring STRINGID_SHEDITSTAIL | ||
waitmessage B_WAIT_TIME_LONG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point you need to call the moveend effects so things like HP restoring berries activate before the switchout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this happen? Do moveend effects happen before the baton pass or u-turn switch out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each switchout move is its own case. U-Turn and Volt Switch for example can activate contact Abilities, while Baton Pass doesn't need to at all. In the case of Shed Tail, the user's HP is restored via a held Berry before switching out.
datahpupdate BS_ATTACKER | ||
printstring STRINGID_SHEDITSTAIL | ||
waitmessage B_WAIT_TIME_LONG | ||
openpartyscreen BS_ATTACKER, BattleScript_ButItFailed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should jump to a preexisting battle script for pivoting out. I'm sure plenty exist to choose from given the number of different pivot moves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't one. They all individually do the code for a switch out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should consolidate them then because there's a lot of reusable code from the different pivoting moves.
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_TidyUpTryHazards | ||
printfromtable gStatUpStringIds | ||
waitmessage B_WAIT_TIME_LONG | ||
BattleScript_TidyUpTryHazards: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hazards are supposed to be removed before the stat changes. Once the order is fixed, you can also just jump to the Dragon Dance battle script to avoid duplicating code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did you get this from? Defog raises evasiveness before clearing hazards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://youtu.be/n0_8i17k1RE?si=Cclst_BjTd9869pB&t=410
It's a dangerous trap to equate two similar yet unrelated effects. You can't rely on GameFreak to do things consistently.
playstatchangeanimation BS_TARGET, BIT_ATK, STAT_CHANGE_BY_TWO | ||
setstatchanger STAT_ATK, 2, FALSE | ||
statbuffchange STAT_CHANGE_ALLOW_PTR | STAT_CHANGE_NOT_PROTECT_AFFECTED, BattleScript_SpicyExtractDefDown | ||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_SpicyExtractDefDown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be when greater than. The message that the stat can't be raised should print if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any other stat change that uses greater than for this.
Also it does print the message that the stat can't be raised? The printfromtable command right below does it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you're skipping it. How can the printfromtable
command be reached if you're jumping to BattleScript_SpicyExtractDefDown
when the message is B_MSG_STAT_WONT_INCREASE
?
playstatchangeanimation BS_TARGET, BIT_DEF, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO | ||
setstatchanger STAT_DEF, 2, TRUE | ||
statbuffchange STAT_CHANGE_ALLOW_PTR | STAT_CHANGE_NOT_PROTECT_AFFECTED, BattleScript_EffectSpicyExtract_End | ||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_EffectSpicyExtract_End |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here as the above comment.
Co-authored-by: Martin Griffin <martinrgriffin@gmail.com>
Decided I am going to split this into separate PRs. Will be easier to debug and review that way. |
Description
Issue(s) that this PR fixes
Closes #2491
Closes #2498
Closes #2499
Closes #2504
Closes #2506
Discord contact info
kittenchilly