Skip to content
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

[Bug] Stakeout should trigger if the enemy switches with U-Turn/etc #4918

Open
wants to merge 1 commit into
base: beta
Choose a base branch
from

Conversation

DayKev
Copy link
Collaborator

@DayKev DayKev commented Nov 19, 2024

What are the changes the user will see?

Stakeout will now trigger when a Pokémon switches in from U-Turn/etc.

Why am I making these changes?

Move is bugged, see #3503 (comment)

What are the changes from a developer perspective?

Trigger condition for Stakeout changed to use the recently added PokemonTurnData.switchedInThisTurn, tests added.

How to test the changes?

npm run test stakeout

Checklist

  • I'm using beta as my base branch
  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
  • Have I provided a clear explanation of the changes?
  • [ ] Have I tested the changes manually?
  • Are all unit tests still passing? (npm run test)
    • Have I created new automated tests (npm run create-test) or updated existing tests related to the PR's changes?
  • [ ] Have I provided screenshots/videos of the changes (if applicable)?
    • [ ] Have I made sure that any UI change works for both UI themes (default and legacy)?

@DayKev DayKev added Move Affects a move P2 Bug Minor. Non crashing Incorrect move/ability/interaction labels Nov 19, 2024
@DayKev DayKev requested a review from a team as a code owner November 19, 2024 08:24
@@ -5948,7 +5948,7 @@ export function initAbilities() {
.bypassFaint()
.partial(), // Meteor form should protect against status effects and yawn
new Ability(Abilities.STAKEOUT, 7)
.attr(MovePowerBoostAbAttr, (user, target, move) => user?.scene.currentBattle.turnCommands[target?.getBattlerIndex() ?? BattlerIndex.ATTACKER]?.command === Command.POKEMON, 2),
.attr(MovePowerBoostAbAttr, (user, target, move) => !!target?.turnData.switchedInThisTurn, 2),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe switchedInThisTurn is boolean, does this still require a double bang?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iirc it was because target could be null and/or undefined (hence the ?), I'll double-check though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm talking about the !! which is used to convert it to boolean - but it already is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Move Affects a move P2 Bug Minor. Non crashing Incorrect move/ability/interaction
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

4 participants