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

[Move] Partially Implement Instruct #4857

Merged
merged 34 commits into from
Dec 1, 2024
Merged

Conversation

Bertie690
Copy link
Contributor

@Bertie690 Bertie690 commented Nov 12, 2024

Locales PR (merged)

What are the changes the user will see?

Instruct will actually work and calls the target's last used move correctly.
It currently does not play nice with Gigaton Hammer, Blood Moon and Torment, but those are related to the janky implementation of those moves currently. #4289
Also pledge jank happens currently.
Also the enemy cannot really use it atm but that's a topic for the upcoming AI reworks!!!

Why am I making these changes?

Because I want funny klefki prankster instructing power trick shuckle rock slide.

What are the changes from a developer perspective?

Added RepeatMoveAttr for moves that force targets to repeat moves themselves. (This is distinct from CopyMoveAttr which has the user copy a target's previous move)

Screenshots/Videos

Instruct repeating an ally's rock slide & subsequently failing on enemy Unown due to it not having made moves yet:
https://github.com/user-attachments/assets/d4ee43d5-d324-4f5e-824d-76aac5e26ea1
It sorta works on pledges... a bit
https://github.com/user-attachments/assets/60490c80-57bd-43cd-8d0b-66ea511803bb
Instruct fails when used on Instruct (Full list of moves on Bulbapedia):
https://github.com/user-attachments/assets/b9a22fa2-ab67-4d1d-bd6b-81b855fa545a

How to test the changes?

Run npm run test instruct

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 considered writing automated tests for the issue?
  • If I have text, did I make it translatable and add a key in the English locale file(s)?
  • Have I tested the changes (manually)?
    • Are all unit tests still passing? (npm run test)
  • Are the changes visual?
    • Have I provided screenshots/videos of the changes?

@Bertie690 Bertie690 requested a review from a team as a code owner November 12, 2024 18:03
@torranx torranx added the Move Affects a move label Nov 12, 2024
Copy link
Contributor

@torranx torranx left a comment

Choose a reason for hiding this comment

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

stopped reviewing after seeing a lot of TODOs, maybe place this in draft for now if its not ready for review - or do you intend them to be in a separate PR?

src/data/move.ts Outdated Show resolved Hide resolved
src/data/move.ts Outdated Show resolved Hide resolved
@torranx
Copy link
Contributor

torranx commented Nov 12, 2024

also is there a reason why this is not using MoveRestrictionBattlerTag? How does this implementation interact with moves like Disable and Throat Chop? nvm saw the tests

@Bertie690
Copy link
Contributor Author

Bertie690 commented Nov 12, 2024

stopped reviewing after seeing a lot of TODOs, maybe place this in draft for now if its not ready for review - or do you intend them to be in a separate PR?

My thought is that those fixes can probably go in a separate PR. This is partially implementing it after all!

also is there a reason why this is not using MoveRestrictionBattlerTag? How does this implementation interact with moves like Disable and Throat Chop?

Testing it again now, but the intended behavior is that Instruct itself will succeed but the called move will fail.

src/test/moves/instruct.test.ts Outdated Show resolved Hide resolved
src/test/moves/instruct.test.ts Outdated Show resolved Hide resolved
@torranx
Copy link
Contributor

torranx commented Nov 12, 2024

My thought is that those fixes can probably go in a separate PR. This is partially implementing it after all!

no problem 👍

Testing it again now, but the intended behavior is that Instruct itself will succeed but the called move will fail.
Torment is a special case: it should prevent move selection but not move execution.

ok so I've misunderstood the move, re-read the move description and watched some clips - MoveRestrictionBattlerTag is not the way to go yes: here's a detailed yt video on the move's mechanics.

(mb messed up and edited your comment instead of quote-replying- hope I put it back right)

Copy link
Collaborator

@DayKev DayKev left a comment

Choose a reason for hiding this comment

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

Found an issue where because Instruct was causing the Pokémon to use 2 moves in a single turn, the firstHit value was false in MoveEffectPhase for the second move when it shouldn't be. I fixed it for when the Instruct user moves after the target in the same turn, but the issue will still happen if the Instruct user moves first. Still need to look into that scenario.

Also fixed up the tests.

Since there were too many changes to reasonably use GitHub's suggestions feature, I made a PR instead: Bertie690#1

@DayKev DayKev added the Enhancement New feature or request label Nov 13, 2024
@Bertie690
Copy link
Contributor Author

Since there were too many changes to reasonably use GitHub's suggestions feature, I made a PR instead: Bertie690#1

Cool. When do you want me to merge it?
(I'd presume by your earlier part of the message that the bug isn't 100% fixed yet)

innerthunder
innerthunder previously approved these changes Nov 16, 2024
torranx
torranx previously approved these changes Nov 16, 2024
Fixed test passing regardless of intended result
@Bertie690 Bertie690 dismissed stale reviews from torranx and innerthunder via 3657b3e November 16, 2024 18:30
@MokaStitcher MokaStitcher added the Awaiting Locales This PR makes changes to existing locales and requires further review label Nov 30, 2024
@MokaStitcher
Copy link
Contributor

@Bertie690 what's the status on the locale PR for this one? Seems like it's still marked as draft

@Bertie690
Copy link
Contributor Author

Bertie690 commented Nov 30, 2024

AFAIK, it seems the non-English locale keys haven't been added yet.

@MokaStitcher
Copy link
Contributor

MokaStitcher commented Nov 30, 2024

AFAIK, it seems the non-English locale keys haven't been added yet.

Well yes, since the PR for the English key is still in draft there is no chance translations have been done. Why is it in draft is my question, is it not ready and needed for this PR ? pagefaultgames/pokerogue-locales#47

edit: to clarify, the english PR needs to go in first before the translations can start happening with the dedicated tool

@MokaStitcher
Copy link
Contributor

Sorry for the accidental closure of the PR 💀

@MokaStitcher MokaStitcher removed the Awaiting Locales This PR makes changes to existing locales and requires further review label Dec 1, 2024
@DayKev DayKev merged commit 1607a69 into pagefaultgames:beta Dec 1, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Move Affects a move
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants