-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Gen 1: Fix Haze and Disable #8807
Conversation
Changes in string quotes are based off of https://github.com/smogon/pokemon-showdown/blob/master/CONTRIBUTING.md#strings I got it wrong before and also fixed the formatting for the rest of the test cases. Additionally, I changed back the disable turn range to 1-7 because I realized making it 0 breaks stuff (disable will last indefinitely) |
sim/battle.ts
Outdated
@@ -834,6 +834,14 @@ export class Battle { | |||
// ('0000' + (this.event.modifier * 4096).toString(16)).slice(-4).toUpperCase()); | |||
relayVar = this.modify(relayVar, this.event.modifier); | |||
} | |||
|
|||
// handle haze/thawing in gen 1 here since it needs to be part of the BeforeMove event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't feel like the right place for this, but I'm not familiar enough with the simulation engine to say where it should go instead, so I guess it's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the new lastStatusCuredThisTurn
property is necessary. I would try investigate if onEnd()
for slp and frz can be leveraged.
Hey there, thanks for the review. I have a few notes on the commit I just made for things I did not address in my changes to the code.
The backwards inheritance from gen 8 was causing a lot of issues for disable, namely with its validity conditions and its duration mechanic, so I decided to stop using inheritance for disable to be safe.
This function isn't supposed to return if the two conditions (finding a move with more than 0 pp and not being disabled already) are true, so I added an
Unfortunately, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine to me, although I'm not too familiar with Gen 1 mechanics.
This should probably be addressed in the future, but inheritance bugs aren't really in the scope of this PR. |
I appreciate your patience here @gigalh128; thank you much for the fix! |
I wrote many more test cases for the functionality of both haze and disable from generation 1. Please take a look at the way I implemented the fix for pokemon not being able to move on the turn they are healed by haze/thawed because I'm not 100% certain that this is the correct way to do this.