forked from DizzyEggg/pokeemerald
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add B_FLAG_SLEEP_CLAUSE #5566
Open
Pawkkie
wants to merge
65
commits into
rh-hideout:upcoming
Choose a base branch
from
Pawkkie:sleep-clause
base: upcoming
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add B_FLAG_SLEEP_CLAUSE #5566
+2,032
−22
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add one test case and several TODO battle tests
…nts near places that will need handling, took a stab at items that cure sleep but no dice
Sleep Clause Tests
WIP: even more sleep clause
FLAG_SET in tests doesn't work properly, see conversation around here https://discord.com/channels/419213663107416084/774393519569502268/1298324354156728330
iriv24
reviewed
Oct 25, 2024
Finally ready for review! :) |
AlexOn1ine
reviewed
Oct 25, 2024
AlexOn1ine
reviewed
Oct 28, 2024
… move check for sleep clause flag inside it
AlexOn1ine
reviewed
Oct 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Up front this is an enormously collaborative PR that @iriv24 and I have been working on a for a few months, happy to finally PR it. This PR adds B_FLAG_SLEEP_CLAUSE that can be set with a flag to enable sleep clause per-battle.
This sleep clause implementation follows Smogon's philosophy: "If a player has already put a Pokemon on his/her opponent's side to sleep and it is still sleeping, another one can't be put to sleep."
Notably this differs from Bulbapedia's description of how Rest specifically behaves in official titles that have supported sleep clause (Stadium, Colosseum, and XD). In those games, Rest seems to activate sleep clause (if I am reading through Bulbapedia's typo correctly), while in Smogon / Showdown supported metagames, any self inflicted sleep does not activate sleep clause (Rest, Effect Spore, etc.).
I don't feel this unique Rest behaviour is worth a config, but we can add one if it's considered blocking. Good candidate for a future follow-up PR.
The implementation was written from tests / scenarios first, so the test suite is very extensive. If anyone can think of additional scenarios we should include tests for, feel free to suggest them!
EDIT: Please enjoy this video of iriv doing some manual testing for some of the cases, particularly sleep due to disobedience which we can't cover with the battle tests.
Issue(s) that this PR fixes
Closes #5576 (mgriffin approved lol)
New KNOWN_FAILING Tests
Sleep Clause: Sleep clause is deactivated when a sleeping mon is woken up by using Sleep Talk into a status curing move
: Fails due to #5557, sleep clause implementation works as intended.Sleep Clause: Sleep clause is deactivated when a sleeping mon is sent out and transforms into a mon with Insomnia / Vital spirit
: Fails due to #5564, sleep clause implementation works as intended.Sleep Clause: Mold Breaker Pokémon sleeping Vital Spirit / Insomnia activates sleep clause
: Fails due to #5578 , sleep clause implementation works as intended.People who collaborated with me in this PR
@Pawkkie
@iriv24
Things to note in the release changelog:
Discord contact info
@Pawkkie
@iriv24