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

Implement Dancer using the battle queue and the AnyAfterMove event #10975

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

andrebastosdias
Copy link
Contributor

@andrebastosdias andrebastosdias commented Mar 16, 2025

Closes #10929

noCopy: true, // doesn't get copied by Baton Pass
onBeforeMovePriority: 200,
onBeforeMove(source, target, move) {
this.add('-activate', source, 'ability: Dancer');
Copy link
Contributor

Choose a reason for hiding this comment

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

This will erroneously announce Dancer if the Pokemon also has Magic Coat active, the dance move is Feather Dance, and there's a second, slower Dancer on the field that targets this Pokemon with its own copied Feather Dance. We need a way to ensure this announcement only happens for the right move. Maybe Battle#runMove could just run an '-activate' message for externalMoves with a sourceEffect? Dancer is the only effect that uses externalMove right now.

Copy link
Contributor Author

@andrebastosdias andrebastosdias Mar 16, 2025

Choose a reason for hiding this comment

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

Can't we just check if it is an external move? Would a move reflected by Magic Coat have the external flag?

sim/battle.ts Outdated
if (!action.speed) {
if (updateSpeed) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why didn't this work?

Copy link
Contributor Author

@andrebastosdias andrebastosdias Mar 16, 2025

Choose a reason for hiding this comment

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

!action.speed gives errors on other tests that update speed mid turn (e.g. Megas). updateSpeed is not passing the should activate in order of lowest to highest raw speed test.

Copy link
Contributor Author

@andrebastosdias andrebastosdias Mar 16, 2025

Choose a reason for hiding this comment

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

if (!action.externalMove) { is a still hack, but at least is working correctly. I don't know why the argument updateSpeed was allowing the speed to be updated when false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mechanic Bug: Dancer & Eject Button resolve in the wrong order
2 participants