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] Implement Heal Block #4120

Merged
merged 17 commits into from
Sep 21, 2024
Merged

Conversation

frutescens
Copy link
Collaborator

@frutescens frutescens commented Sep 9, 2024

Old PRs: #3326 #3047

What are the changes the user will see?

Heal Block will be implemented.
Psychic Noise will have its secondary effect implemented - Heal Block will be applied to the opponent for two turns.

Why am I making these changes?

Attempt to get rid of partial tags.

What are the changes from a developer perspective?

HealBlockTag prevents healing in HealPhase. The Regenerator ability is unaffected by Heal Block because it does not use Heal Phase for its healing. but also extends upon the MoveRestrictionBattlerTag to restrict the use of healing moves while the tag is still in effect. The move restriction is based on if the move is a status move and has a TRIAGE_MOVE flag. This avoids adding another redundant flag since attacking moves that heal are not banned with Heal Block. In addition, Heal Block-exempt moves like Pain Split do not have the Triage Flag. There is one exception to this condition however - Pollen Puff.

Pollen Puff has two different effects depending on the move's target. If it targets an opponent, it is a 90 BP attack. If it targets an ally, it is a healing move. Heal Block prevents the affected from using Heal Block towards allies, but allows for it to be used against opponents. This means that it cannot be disabled in Command Phase, like most moves, and must be disabled in Select Target Phase. MoveRestrictionBattlerTag was created based on preventing the use of moves in Command Phase, not Select Target Phase, so I added new functions and parameters to check that Pollen Puff had an allowed use case. Pollen Puff has an attribute StatusCategoryOnAllyAttr but because it was never applied in-game until now, it didn't work. This attribute was fixed to check if the user and the target are allies. Arguably, these new additions should help with Taunt's implementation.

Psychic Noise and Heal Block share similar implementations. However, Psychic Noise is allowed to hit the user again even when Heal Block is active while Heal Block (the move) should fail when the user already has an Heal Block tag.

Screenshots/Videos

Pollen Puff

freecompress-Screen.Recording.2024-09-20.at.5.05.02.PM.mp4

How to test the changes?

Use heal block on a Pokemon and damage it afterwards to see if it can heal or not.

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?

@flx-sta flx-sta added Move Affects a move Enhancement New feature or request labels Sep 9, 2024
@DayKev DayKev changed the title [Move] Heal Block [Move] Implement Heal Block Sep 16, 2024
@DayKev DayKev self-assigned this Sep 16, 2024
frutescens and others added 3 commits September 16, 2024 00:39
Co-authored-by: Lugiad' <[email protected]>
Co-authored-by: José Ricardo Fleury Oliveira <[email protected]>
Co-authored-by: Jannik Tappert <[email protected]>
Co-authored-by: Asdar <[email protected]>
@DayKev
Copy link
Collaborator

DayKev commented Sep 16, 2024

Fixed the git history and added the code from the previous PR (also updated the tests to use the latest functions/etc).

@DayKev
Copy link
Collaborator

DayKev commented Sep 16, 2024

Still needs implementation of disabling healing moves (see #2051 for details if necessary).

During the effect, healing and draining moves are unusable
...
Pain Split and the Regenerator Ability are unaffected.

@frutescens frutescens marked this pull request as ready for review September 20, 2024 23:36
@frutescens frutescens requested review from a team as code owners September 20, 2024 23:36
src/data/move.ts Outdated Show resolved Hide resolved
src/data/battler-tags.ts Outdated Show resolved Hide resolved
src/data/battler-tags.ts Outdated Show resolved Hide resolved
src/data/battler-tags.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@innerthunder innerthunder left a comment

Choose a reason for hiding this comment

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

You might want to look into modifying getMoveTargets in data/move.ts to add the Pollen Puff interaction. Enforcing it at the UI level (or within the select target phase in general) still allows enemies to target their allies under Heal Block.

src/data/move.ts Outdated Show resolved Hide resolved
src/phases/select-target-phase.ts Outdated Show resolved Hide resolved
@frutescens
Copy link
Collaborator Author

@innerthunder I'm confused about some of your comments because I think it's not accurate to how the move actually works. I attached a video of Pollen Puff now, so hopefully it'll answer some of your comments.

@innerthunder
Copy link
Collaborator

@innerthunder I'm confused about some of your comments because I think it's not accurate to how the move actually works. I attached a video of Pollen Puff now, so hopefully it'll answer some of your comments.

Doesn't showdown just prevent you from selecting the ally when they're Heal Blocked? I haven't looked into how it works in mainline (like when the ally target is hit with Psychic Noise).

In any case, the way it works right now probably requires some changes to the AI to have the enemy properly respond to Heal Block, but you don't have to worry about it too much.

@innerthunder innerthunder dismissed their stale review September 21, 2024 00:23

Not a blocker. Seems to work ok on the UI side

@frutescens
Copy link
Collaborator Author

frutescens commented Sep 21, 2024

Showdown's implementation is technically correct. However, in PokeRogue, doing so means placing TargetSelectPhase into a while-loop or something similar until the user chooses a valid target or exits out (targets = []), which I feel will lead to more unintended effects than booting the user back into command phase. Technically, you can't select the ally Pokemon too, so I think it's fine.
I can fix up enemy command phase too, but enemy Pokemon tend to be not really interested in healing each other right now.

@frutescens frutescens merged commit 4fb76fd into pagefaultgames:beta Sep 21, 2024
14 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.

6 participants